on xenial help sign in
MenuItemFactory: use more features from SlotsLayout based settings components

Remove some legacy elements that were needed before Approved by: Albert Astals Cid

commite7bed11b1b1f3cae19802c668d37b29d8e509d7e authorMarco Trevisan (Treviño) <mail@3v1n0.net> dateMon 24 Oct 2016, 11:35 (10 years ago) parent1f0ce583b6ef13
6 files changed+322−187
debian/control+1−1 qml/Panel/Indicators/MenuItemFactory.qml+98−146 tests/mocks/Unity/Indicators/IndicatorsModel.qml+1−1 tests/mocks/Unity/Indicators/fakeindicatorsmodeldata.js+220−32 tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml+1−6 tests/qmltests/Panel/tst_IndicatorPage.qml+1−1
debian/control+1−1
@@ -65,7 +65,7 @@ Build-Depends: cmake,
6565 qtdeclarative5-dev-tools,
6666 qtdeclarative5-private-dev (>= 5.4),
6767 qtdeclarative5-ubuntu-content1,
68− qtdeclarative5-ubuntu-settings-components (>= 0.7),
68+ qtdeclarative5-ubuntu-settings-components (>= 0.10),
6969 ttf-ubuntu-font-family,
7070Standards-Version: 3.9.4
7171Homepage: http://launchpad.net/unity
qml/Panel/Indicators/MenuItemFactory.qml+98−146
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2013,2015 Canonical Ltd.
2+ * Copyright 2013-2016 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU Lesser General Public License as published by
@@ -31,7 +31,8 @@ Item {
3131 property var rootModel: null
3232 property var menuModel: null
3333
34− property var _map: {
34+ property var _userMap: null
35+ readonly property var _typeToComponent: {
3536 "default": {
3637 "unity.widgets.systemsettings.tablet.volumecontrol" : sliderMenu,
3738 "unity.widgets.systemsettings.tablet.switch" : switchMenu,
@@ -69,11 +70,62 @@ Item {
6970 "indicator.guest-menu-item": Platform.isPC ? userMenuItem : null,
7071 "com.canonical.indicator.switch": Math.min(Screen.width, Screen.height) > units.gu(60) ? switchMenu : null // Desktop mode switch
7172 },
72− "indicator-messages" : {
73− "com.canonical.indicator.button" : messagesButtonMenu
73+ "indicator-messages": {
74+ "com.canonical.indicator.button": messagesButtonMenu
7475 }
7576 }
7677
78+ readonly property var _action_filter_map: {
79+ "indicator-session": {
80+ "indicator.logout": Platform.isPC ? undefined : null,
81+ "indicator.suspend": Platform.isPC ? undefined : null,
82+ "indicator.hibernate": Platform.isPC ? undefined : null,
83+ "indicator.reboot": Platform.isPC ? undefined : null
84+ },
85+ "indicator-keyboard": {
86+ "indicator.map": null,
87+ "indicator.chart": null
88+ }
89+ }
90+
91+ function getComponentForIndicatorEntryType(indicator, type) {
92+ var component = undefined;
93+ var map = _userMap || _typeToComponent
94+ var indicatorComponents = map[indicator];
95+
96+ if (type === undefined || type === "") {
97+ return component
98+ }
99+
100+ if (indicatorComponents !== undefined) {
101+ component = indicatorComponents[type];
102+ }
103+
104+ if (component === undefined) {
105+ component = map["default"][type];
106+ }
107+
108+ if (component === undefined) {
109+ console.debug("Don't know how to make " + modelData.type + " for " + indicator);
110+ }
111+
112+ return component
113+ }
114+
115+ function getComponentForIndicatorEntryAction(indicator, action) {
116+ var component = undefined;
117+ var indicatorFilter = _action_filter_map[indicator]
118+
119+ if (action === undefined || action === "") {
120+ return component
121+ }
122+
123+ if (indicatorFilter !== undefined) {
124+ component = indicatorFilter[action];
125+ }
126+ return component
127+ }
128+
77129 function getExtendedProperty(object, propertyName, defaultValue) {
78130 if (object && object.hasOwnProperty(propertyName)) {
79131 return object[propertyName];
@@ -102,7 +154,6 @@ Item {
102154 property var serverValue: getExtendedProperty(menuData, "actionState", undefined)
103155
104156 text: menuData && menuData.label || ""
105− iconSource: menuData && menuData.icon || ""
106157 minIcon: getExtendedProperty(extendedData, "minIcon", "")
107158 maxIcon: getExtendedProperty(extendedData, "maxIcon", "")
108159
@@ -182,29 +233,20 @@ Item {
182233 Component {
183234 id: messagesButtonMenu;
184235
185− Item {
236+ Menus.BaseLayoutMenu {
186237 objectName: "messagesButtonMenu"
187238 property QtObject menuData: null
188239 property var menuModel: menuFactory.menuModel
189240 property int menuIndex: -1
190241
191− implicitHeight: units.gu(5)
242+ highlightWhenPressed: false
192243 enabled: menuData && menuData.sensitive || false
244+ text: menuData && menuData.label || ""
245+ title.color: theme.palette.selected.backgroundText
246+ title.horizontalAlignment: Text.AlignHCenter
247+ title.font.bold: true
193248
194− Label {
195− id: buttonMenuLabel
196− text: menuData && menuData.label || ""
197− anchors.centerIn: parent
198− font.bold: true
199− }
200−
201− MouseArea {
202− anchors {
203− fill: buttonMenuLabel
204− margins: units.gu(-1)
205− }
206− onClicked: menuModel.activate(menuIndex);
207− }
249+ onClicked: menuModel.activate(menuIndex);
208250 }
209251 }
210252
@@ -233,11 +275,6 @@ Item {
233275 iconSource: menuData && menuData.icon || ""
234276 value : menuData && menuData.actionState || 0.0
235277 enabled: menuData && menuData.sensitive || false
236− // FIXME: Because of this bug, setting it to the theme foreground color (white)
237− // currently doesn't work. Let's hack it to be "close enough"
238− // https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1555784
239− foregroundColor: "#fffffe"
240− highlightWhenPressed: false
241278 }
242279 }
243280
@@ -257,52 +294,41 @@ Item {
257294 onTriggered: {
258295 menuModel.activate(menuIndex);
259296 }
260−
261− // FIXME : At the moment, the indicators aren't using
262− // com.canonical.indicators.link for settings menu. Need to fudge it.
263− property bool settingsMenu: menuData && menuData.action.indexOf("settings") > -1 || false
264− backColor: settingsMenu ? Qt.rgba(1,1,1,0.07) : "transparent"
265− component: settingsMenu ? buttonForSettings : undefined
266− Component {
267− id: buttonForSettings
268− Icon {
269− name: "settings"
270− height: units.gu(3)
271− width: height
272− color: theme.palette.normal.backgroundText
273− }
274− }
275297 }
276298 }
277299
278300 Component {
279301 id: linkMenu;
280302
281− Menus.StandardMenu {
303+ Menus.BaseLayoutMenu {
282304 objectName: "linkMenu"
283305 property QtObject menuData: null
284306 property int menuIndex: -1
285307
286308 text: menuData && menuData.label || ""
287− iconSource: menuData && menuData.icon || ""
288309 enabled: menuData && menuData.sensitive || false
310+ backColor: Qt.rgba(1,1,1,0.07)
289311 highlightWhenPressed: false
290312
291313 onTriggered: {
292314 menuModel.activate(menuIndex);
293315 }
294316
295− backColor: Qt.rgba(1,1,1,0.07)
296−
297− component: menuData.icon ? icon : undefined
298− Component {
299− id: icon
300− Icon {
301− source: menuData.icon
302− height: units.gu(3)
303− width: height
304− color: theme.palette.normal.backgroundText
317+ slots: Icon {
318+ source: {
319+ if (menuData) {
320+ if (menuData.icon && menuData.icon != "") {
321+ return menuData.icon
322+ } else if (menuData.action.indexOf("settings") > -1) {
323+ return "image://theme/settings"
324+ }
325+ }
326+ return ""
305327 }
328+ height: units.gu(3)
329+ width: height
330+ color: theme.palette.normal.backgroundText
331+ SlotsLayout.position: SlotsLayout.Trailing
306332 }
307333 }
308334 }
@@ -769,7 +795,6 @@ Item {
769795 state: getExtendedProperty(actionState, "state", "")
770796 enabled: menuData && menuData.sensitive || false
771797 highlightWhenPressed: false
772− showDivider: false
773798
774799 onTriggered: {
775800 model.activate(modelIndex);
@@ -972,116 +997,43 @@ Item {
972997 menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-extra-label': 'string'});
973998 }
974999
975− component: Component {
976− Button {
977− objectName: "buttonSectionMenuControl"
978− text: getExtendedProperty(extendedData, "xCanonicalExtraLabel", "")
1000+ slots: Button {
1001+ objectName: "buttonSectionMenuControl"
1002+ text: getExtendedProperty(extendedData, "xCanonicalExtraLabel", "")
9791003
980− onClicked: {
981− menuModel.activate(menuIndex);
982− }
1004+ onClicked: {
1005+ menuModel.activate(menuIndex);
9831006 }
9841007 }
9851008 }
9861009 }
9871010
988− Component {
989− id: keymapMenu;
990−
991− // FIXME this should use a "radio button" menu, once we have it in the SDK
992− ListItems.Empty {
993− id: checkItem
994− objectName: "keymapMenu"
995− property QtObject menuData: null
996− property int menuIndex: -1
997− readonly property bool serverChecked: menuData && menuData.isToggled || false
998−
999− enabled: menuData && menuData.sensitive || false
1000− highlightWhenPressed: false
1001− __acceptEvents: !serverChecked
1002−
1003− CheckBox {
1004− id: checkbox
1005− __acceptEvents: !checkItem.serverChecked
1006− anchors {
1007− left: parent.left
1008− leftMargin: checkItem.__contentsMargins
1009− verticalCenter: parent.verticalCenter
1010− }
1011− }
1012−
1013− ServerPropertySynchroniser {
1014− objectName: "sync"
1015− syncTimeout: Utils.Constants.indicatorValueTimeout
1016−
1017− serverTarget: checkItem
1018− serverProperty: "serverChecked"
1019− userTarget: checkbox
1020− userProperty: "checked"
1021−
1022− onSyncTriggered: {
1023− menuModel.activate(checkItem.menuIndex);
1024− }
1025− }
1026−
1027− Label {
1028− id: label
1029− anchors {
1030− left: checkbox.right
1031− leftMargin: checkItem.__contentsMargins
1032− right: parent.right
1033− rightMargin: checkItem.__contentsMargins
1034− verticalCenter: parent.verticalCenter
1035− }
1036− elide: Text.ElideRight
1037− text: checkItem.menuData && checkItem.menuData.label || ""
1038− }
1039−
1040− onClicked: menuModel.activate(menuIndex);
1041− }
1042− }
1043−
10441011 function load(modelData, context) {
1045− // tweak indicator-session items
1046− if (context === "indicator-session") {
1047− if ((modelData.action === "indicator.logout" || modelData.action === "indicator.suspend" || modelData.action === "indicator.hibernate" ||
1048− modelData.action === "indicator.reboot")
1049− && !Platform.isPC) {
1050− return null; // logout, suspend and hibernate hidden on devices
1051− }
1012+ if (context && context.indexOf("fake-") == 0) {
1013+ context = context.substring("fake-".length)
10521014 }
10531015
1054− // specialize for indicator-keyboard
1055− if (context === "indicator-keyboard") {
1056− if (modelData.isRadio) {
1057− return keymapMenu;
1058− } else if (modelData.action === "indicator.map" || modelData.action === "indicator.chart") {
1059− return null; // map and chart not available
1060− }
1016+ var component = getComponentForIndicatorEntryAction(context, modelData.action)
1017+ if (component !== undefined) {
1018+ return component
10611019 }
10621020
1063− if (modelData.type !== undefined && modelData.type !== "") {
1064− var component = undefined;
1065−
1066− var contextComponents = _map[context];
1067− if (contextComponents !== undefined) {
1068− component = contextComponents[modelData.type];
1069− }
1070−
1071− if (component === undefined) {
1072− component = _map["default"][modelData.type];
1073− }
1074− if (component !== undefined) {
1075− return component;
1076− }
1077− console.debug("Don't know how to make " + modelData.type + " for " + context);
1021+ component = getComponentForIndicatorEntryType(context, modelData.type)
1022+ if (component !== undefined) {
1023+ return component;
10781024 }
1025+
10791026 if (modelData.isCheck || modelData.isRadio) {
10801027 return checkableMenu;
10811028 }
10821029 if (modelData.isSeparator) {
10831030 return separatorMenu;
10841031 }
1032+ if (modelData.action !== undefined && modelData.action.indexOf("settings") > -1) {
1033+ // FIXME : At the moment, the indicators aren't using
1034+ // com.canonical.indicators.link for settings menu. Need to fudge it.
1035+ return linkMenu;
1036+ }
10851037 return standardMenu;
10861038 }
10871039}
tests/mocks/Unity/Indicators/IndicatorsModel.qml+1−1
@@ -124,7 +124,7 @@ Indicators.FakeIndicatorsModel {
124124
125125 Indicators.UnityMenuModelCache.setCachedModelData("/com/canonical/indicators/fake0",
126126 getUnityMenuModelData("indicator-keyboard",
127− "Czech (F)",
127+ "English (F)",
128128 "",
129129 [ "image://theme/input-keyboard-symbolic" ]));
130130 Indicators.UnityMenuModelCache.setCachedModelData("/com/canonical/indicators/fake1",
tests/mocks/Unity/Indicators/fakeindicatorsmodeldata.js+220−32
@@ -30,7 +30,7 @@ var fakeMenuData = {
3030 "type": "com.canonical.indicator.messages.messageitem",
3131 "ext": {
3232 "icon": "file:///usr/share/ubuntu/settings/system/icons/settings-system-update.svg",
33− "xCanonicalAppIcon": "file:///usr/share/ubuntu/settings/system/system-settings.png",
33+ "xCanonicalAppIcon": "image://theme/system-settings",
3434 "xCanonicalMessageActions": null,
3535 "xCanonicalText": "Tap to open the system updater.",
3636 "xCanonicalTime": ((new Date).getTime() - 350 * 1000) * 1000,
@@ -47,12 +47,12 @@ var fakeMenuData = {
4747 "action": "indicator.telephony-service-sms.msg.MSG_ID",
4848 "actionState": {},
4949 "ext": {},
50− "icon": "file:///usr/share/telephony-service/assets/avatar-default@18.png",
50+ "icon": Qt.resolvedUrl("../../../../../tests/graphics/avatars/funky@12.png"),
5151 "type": "com.canonical.indicator.messages.messageitem",
5252 "ext": {
53− "icon": "file:///usr/share/telephony-service/assets/avatar-default@18.png",
54− "xCanonicalAppIcon": "image://theme/telephony-service-message",
55− "xCanonicalMessageActions": "",
53+ "icon": Qt.resolvedUrl("../../../../../tests/graphics/avatars/funky@12.png"),
54+ "xCanonicalAppIcon": Qt.resolvedUrl("../../../../../tests/graphics/applicationIcons/messages-app@18.png"),
55+ "xCanonicalMessageActions": [ { "parameter-type": "s" } ],
5656 "xCanonicalText": "This is a message sent to an awesome Ubuntu phone.",
5757 "xCanonicalTime": ((new Date).getTime() - 35 * 1000) * 1000
5858 },
@@ -64,6 +64,25 @@ var fakeMenuData = {
6464 "sensitive": true
6565 }
6666 },
67+ {
68+ "rowData": {
69+ "label": "+39441234567 - [SIM 2]",
70+ "sensitive": true,
71+ "isSeparator": false,
72+ "icon": "image://theme/missed-call",
73+ "type": "com.canonical.indicator.messages.messageitem",
74+ "ext": {
75+ "xCanonicalMessageActions": [ { "parameter-type": "_s" } ],
76+ "xCanonicalText": "1 Missed call.",
77+ "xCanonicalTime": ((new Date).getTime() - 350 * 1000) * 1000,
78+ },
79+ "action": "indicator.telephony-service-missed-call.call.CALL_ID",
80+ "actionState": {},
81+ "isCheck": false,
82+ "isRadio": false,
83+ "isToggled": false,
84+ }
85+ },
6786 {
6887 "rowData": {
6988 "action": "indicator.remove-all",
@@ -337,34 +356,72 @@ var fakeMenuData = {
337356 "type": "com.canonical.indicator.root"
338357 },
339358 "submenu": [
340− {
359+ {
360+ "rowData": {
361+ "label": "Charge Level",
362+ "sensitive": false,
363+ "isSeparator": false,
364+ "icon": "",
365+ "type": "com.canonical.indicator.progress",
366+ "ext": {},
367+ "action": "indicator.battery-level",
368+ "actionState": "100",
369+ "isCheck": false,
370+ "isRadio": false,
371+ "isToggled": false
372+ }
373+ },
374+ {
375+
376+ "rowData": {
377+ "label": "",
378+ "sensitive": true,
379+ "isSeparator": true,
380+ "icon": "",
381+ "type": "",
382+ "ext": {},
383+ "action": "",
384+ "actionState": "",
385+ "isCheck": false,
386+ "isRadio": false,
387+ "isToggled": false
388+ }
389+ },
390+ {
391+
392+ "rowData": {
393+ "label": "",
394+ "sensitive": true,
395+ "isSeparator": false,
396+ "icon": "",
397+ "type": "com.canonical.unity.slider",
398+ "ext": {
399+ "maxIcon": "image://theme/display-brightness-max",
400+ "maxValue": "1",
401+ "minIcon": "image://theme/display-brightness-min",
402+ "minValue": "0",
403+ },
404+ "action": "indicator.brightness",
405+ "actionState": "0.212244897959184",
406+ "isCheck": false,
407+ "isRadio": false,
408+ "isToggled": false
409+ }
410+ },
411+ {
412+
341413 "rowData": {
342− "action": "indicator.activate-statistics",
343− "actionState": {},
344− "ext": {},
345− "icon": "image://theme/battery-full-charged-symbolic",
346− "isCheck": false,
347− "isRadio": false,
348− "isSeparator": false,
349− "isToggled": false,
350− "label": "Battery (full charged)",
414+ "label": "Auto-brightness",
351415 "sensitive": true,
352− "type": "com.canonical.indicator.basic"
353− }
354− },
355− {
356− "rowData": {
357− "action": "indicator.activate-statistics",
358− "actionState": {},
416+ "isSeparator": false,
417+ "icon": "",
418+ "type": "com.canonical.indicator.switch",
359419 "ext": {},
360− "icon": "image://theme/battery-100",
361− "isCheck": false,
420+ "action": "indicator.auto-brightness",
421+ "actionState": false,
422+ "isCheck": true,
362423 "isRadio": false,
363− "isSeparator": false,
364− "isToggled": false,
365− "label": "Battery",
366− "sensitive": true,
367− "type": "com.canonical.indicator.basic"
424+ "isToggled": false
368425 }
369426 },
370427 {
@@ -555,7 +612,6 @@ var fakeMenuData = {
555612 }
556613 ],
557614
558−
559615 "fake-indicator-datetime": [
560616 {
561617 "rowData": {
@@ -591,6 +647,25 @@ var fakeMenuData = {
591647 "type": ""
592648 }
593649 },
650+ {
651+ "rowData": {
652+ "action": "indicator.calendar",
653+ "actionState": {
654+ "appointment-days": "",
655+ "calendar-day": (new Date).getTime() / 1000,
656+ "show-week-numbers": false,
657+ },
658+ "ext": {},
659+ "icon": "image://theme/calendar",
660+ "isCheck": false,
661+ "isRadio": true,
662+ "isSeparator": false,
663+ "isToggled": false,
664+ "label": "[calendar]",
665+ "sensitive": true,
666+ "type": "com.canonical.indicator.calendar"
667+ }
668+ },
594669 {
595670 "rowData": {
596671 "action": "",
@@ -727,7 +802,6 @@ var fakeMenuData = {
727802 }
728803 ],
729804
730−
731805 "fake-indicator-files": [
732806 {
733807 "rowData": {
@@ -1102,5 +1176,119 @@ var fakeMenuData = {
11021176 }
11031177 ]
11041178 }
1105− ]
1179+ ],
1180+
1181+ "indicator-keyboard": [
1182+ {
1183+ "rowData": {
1184+ "action": "indicator.indicator",
1185+ "actionState": {
1186+ "icons": [],
1187+ "label": "",
1188+ "title": "English (USA, QWERTY)",
1189+ "visible": true
1190+ },
1191+ "icon": "",
1192+ "isCheck": false,
1193+ "isRadio": false,
1194+ "isSeparator": false,
1195+ "isToggled": false,
1196+ "label": "",
1197+ "sensitive": true,
1198+ "type": "com.canonical.indicator.root"
1199+ },
1200+ "submenu": [
1201+ {
1202+ "rowData": {
1203+ "label": "České (QWERTY)",
1204+ "sensitive": true,
1205+ "isSeparator": false,
1206+ "icon": "image://theme/indicator-keyboard-Cs",
1207+ "type": "",
1208+ "ext": {},
1209+ "action": "indicator.current",
1210+ "actionState": 0,
1211+ "isCheck": false,
1212+ "isRadio": true,
1213+ "isToggled": false
1214+ }
1215+ },
1216+ {
1217+ "rowData": {
1218+ "label": "Italiana (QWERTY)",
1219+ "sensitive": true,
1220+ "isSeparator": false,
1221+ "icon": "image://theme/indicator-keyboard-It",
1222+ "type": "",
1223+ "ext": {},
1224+ "action": "indicator.current",
1225+ "actionState": 0,
1226+ "isCheck": false,
1227+ "isRadio": true,
1228+ "isToggled": false
1229+ }
1230+ },
1231+ {
1232+ "rowData": {
1233+ "label": "English (USA)",
1234+ "sensitive": true,
1235+ "isSeparator": false,
1236+ "icon": "image://theme/indicator-keyboard-En",
1237+ "type": "",
1238+ "ext": {},
1239+ "action": "indicator.current",
1240+ "actionState": 0,
1241+ "isCheck": false,
1242+ "isRadio": true,
1243+ "isToggled": true
1244+ }
1245+ },
1246+ {
1247+ "rowData": {
1248+ "label": "",
1249+ "sensitive": true,
1250+ "isSeparator": true,
1251+ "icon": "",
1252+ "type": "",
1253+ "ext": {},
1254+ "action": "",
1255+ "actionState": "",
1256+ "isCheck": false,
1257+ "isRadio": false,
1258+ "isToggled": false
1259+ }
1260+ },
1261+ {
1262+ "rowData": {
1263+ "label": "Character Map",
1264+ "sensitive": true,
1265+ "isSeparator": false,
1266+ "icon": "",
1267+ "type": "",
1268+ "ext": {},
1269+ "action": "indicator.map",
1270+ "actionState": "",
1271+ "isCheck": false,
1272+ "isRadio": false,
1273+ "isToggled": false
1274+ }
1275+ },
1276+ {
1277+ "rowData": {
1278+ "label": "Keyboard layout",
1279+ "sensitive": true,
1280+ "isSeparator": false,
1281+ "icon": "",
1282+ "type": "",
1283+ "ext": {},
1284+ "action": "indicator.key-map.settings",
1285+ "actionState": "",
1286+ "isCheck": false,
1287+ "isRadio": false,
1288+ "isToggled": false
1289+ }
1290+ }
1291+ ]
1292+ }
1293+ ],
11061294}
tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml+1−6
@@ -396,7 +396,7 @@ Item {
396396
397397 function test_create_appointmentMenu_data() {
398398 return [
399− {label: "testLabel1", enabled: true, icon: "file:///testIcon1", color: Qt.rgba(0, 0, 0, 0),
399+ {label: "testLabel1", enabled: true, icon: "file:///testIcon1", color: Qt.rgba(1, 2, 3, 0),
400400 time: new Date(2014, 04, 14), timeFormat: "%a %d %b %l:%M %p"},
401401 {label: "testLabel2", enabled: false, icon: "file:///testIcon2", color: Qt.rgba(1, 0, 0, 0),
402402 time: new Date(2015, 11, 31), timeFormat: "%A" },
@@ -594,9 +594,7 @@ Item {
594594 // ModemInfoItem gets all it's data through the actions.
595595 return [
596596 {
597− label: "",
598597 enabled: true,
599− checked: false,
600598 statusLabelAction: "action::statusLabel",
601599 statusIconAction: "action::statusIcon",
602600 connectivityIconAction: "action::connectivityIcon",
@@ -609,9 +607,7 @@ Item {
609607
610608 function test_create_modemInfoItem(data) {
611609 menuData.type = "com.canonical.indicator.network.modeminfoitem";
612− menuData.label = data.label;
613610 menuData.sensitive = data.enabled;
614− menuData.isToggled = data.checked;
615611 menuData.ext = {
616612 'xCanonicalModemStatusLabelAction': data.statusLabelAction,
617613 'xCanonicalModemStatusIconAction': data.statusIconAction,
@@ -625,7 +621,6 @@ Item {
625621 loader.sourceComponent = factory.load(menuData);
626622 tryCompareFunction(function() { return loader.item != undefined; }, true);
627623 compare(loader.item.objectName, "modemInfoItem", "Should have created a modem info item.");
628− compare(loader.item.text, data.label, "Label does not match data");
629624
630625 compare(loader.item.statusLabelAction.name, data.statusLabelAction, "StatusLabel action incorrect");
631626 compare(loader.item.statusIconAction.name, data.statusIconAction, "StatusIcon action incorrect");
tests/qmltests/Panel/tst_IndicatorPage.qml+1−1
@@ -36,7 +36,7 @@ Item {
3636 menuObjectPath: "/com/canonical/indicator/test"
3737
3838 factory {
39− _map: {
39+ _userMap: {
4040 "default": {
4141 "com.canonical.indicator.test" : testMenu
4242 }