on xenial help sign in
Added a "-profile" option to the indicator-client to switch between indicator service profiles.
2bed569Nick Dedekind
plugins/Unity/Indicators/indicatorsmanager.cpp+5−4
@@ -26,8 +26,6 @@
26
26
27#include <paths.h>
27#include <paths.h>
28
28
29−const QString profile = "phone";
30−
31
29
32class IndicatorsManager::IndicatorData
30class IndicatorsManager::IndicatorData
33{
31{
@@ -49,6 +47,7 @@ public:
49IndicatorsManager::IndicatorsManager(QObject* parent)
47IndicatorsManager::IndicatorsManager(QObject* parent)
50 : QObject(parent)
48 : QObject(parent)
51 , m_loaded(false)
49 , m_loaded(false)
50+ , m_profile("phone")
52{
51{
53}
52}
54
53
@@ -58,9 +57,11 @@ IndicatorsManager::~IndicatorsManager()
58
57
59}
58}
60
59
61−void IndicatorsManager::load()
60+void IndicatorsManager::load(const QString& profile)
62{
61{
63 unload();
62 unload();
63+ m_profile = profile;
64+
64 QStringList xdgLocations = shellDataDirs();//QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
65 QStringList xdgLocations = shellDataDirs();//QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
65
66
66 m_fsWatcher.reset(new QFileSystemWatcher(this));
67 m_fsWatcher.reset(new QFileSystemWatcher(this));
@@ -300,7 +301,7 @@ Indicator::Ptr IndicatorsManager::indicator(const QString& indicator_name)
300 Indicator::Ptr new_indicator(new Indicator(this));
301 Indicator::Ptr new_indicator(new Indicator(this));
301 data->m_indicator = new_indicator;
302 data->m_indicator = new_indicator;
302 QSettings settings(data->m_fileInfo.absoluteFilePath(), QSettings::IniFormat, this);
303 QSettings settings(data->m_fileInfo.absoluteFilePath(), QSettings::IniFormat, this);
303− new_indicator->init(profile, data->m_fileInfo.fileName(), settings);
304+ new_indicator->init(m_profile, data->m_fileInfo.fileName(), settings);
304 return new_indicator;
305 return new_indicator;
305}
306}
306
307
plugins/Unity/Indicators/indicatorsmanager.h+2−1
@@ -38,7 +38,7 @@ public:
38 explicit IndicatorsManager(QObject* parent = 0);
38 explicit IndicatorsManager(QObject* parent = 0);
39 ~IndicatorsManager();
39 ~IndicatorsManager();
40
40
41− Q_INVOKABLE void load();
41+ Q_INVOKABLE void load(const QString& profile);
42 Q_INVOKABLE void unload();
42 Q_INVOKABLE void unload();
43
43
44 Indicator::Ptr indicator(const QString& indicator_name);
44 Indicator::Ptr indicator(const QString& indicator_name);
@@ -71,6 +71,7 @@ private:
71 QHash<QString, IndicatorData*> m_indicatorsData;
71 QHash<QString, IndicatorData*> m_indicatorsData;
72 QSharedPointer<QFileSystemWatcher> m_fsWatcher;
72 QSharedPointer<QFileSystemWatcher> m_fsWatcher;
73 bool m_loaded;
73 bool m_loaded;
74+ QString m_profile;
74};
75};
75
76
76#endif // INDICATORS_MANAGER_H
77#endif // INDICATORS_MANAGER_H
plugins/Unity/Indicators/indicatorsmodel.cpp+2−2
@@ -85,10 +85,10 @@ int IndicatorsModel::count() const
85
85
86 Load all indicators.
86 Load all indicators.
87*/
87*/
88−void IndicatorsModel::load()
88+void IndicatorsModel::load(const QString& profile)
89{
89{
90 m_indicators.clear();
90 m_indicators.clear();
91− m_manager->load();
91+ m_manager->load(profile);
92}
92}
93
93
94/*!
94/*!
plugins/Unity/Indicators/indicatorsmodel.h+1−1
@@ -40,7 +40,7 @@ public:
40 IndicatorsModel(QObject *parent=0);
40 IndicatorsModel(QObject *parent=0);
41 ~IndicatorsModel();
41 ~IndicatorsModel();
42
42
43− Q_INVOKABLE void load();
43+ Q_INVOKABLE void load(const QString& profile);
44 Q_INVOKABLE void unload();
44 Q_INVOKABLE void unload();
45
45
46 Q_INVOKABLE QVariant data(int row, int role) const;
46 Q_INVOKABLE QVariant data(int row, int role) const;
qml/Panel/Indicators.qml+3−1
@@ -31,6 +31,8 @@ Showable {
31 property bool pinnedMode: true //should be set true if indicators menu can cover whole screen
31 property bool pinnedMode: true //should be set true if indicators menu can cover whole screen
32 property alias overFlowWidth: indicatorRow.overFlowWidth
32 property alias overFlowWidth: indicatorRow.overFlowWidth
33 property alias showAll: indicatorRow.showAll
33 property alias showAll: indicatorRow.showAll
34+ // TODO: This should be sourced by device type (eg "desktop", "tablet", "phone"...)
35+ property string profile: "phone"
34
36
35 readonly property real hintValue: panelHeight + menuContent.headerHeight
37 readonly property real hintValue: panelHeight + menuContent.headerHeight
36 readonly property int lockThreshold: openedHeight / 2
38 readonly property int lockThreshold: openedHeight / 2
@@ -429,6 +431,6 @@ Showable {
429
431
430 Component.onCompleted: initialise();
432 Component.onCompleted: initialise();
431 function initialise() {
433 function initialise() {
432− visibleIndicators.load();
434+ visibleIndicators.load(profile);
433 }
435 }
434}
436}
qml/Panel/Indicators/VisibleIndicators.qml+2−2
@@ -78,7 +78,7 @@ Item {
78 }
78 }
79 }
79 }
80
80
81− function load() {
81+ function load(profile) {
82− indicatorsModel.load();
82+ indicatorsModel.load(profile);
83 }
83 }
84}
84}
qml/Panel/Indicators/client/IndicatorsClient.qml+1−2
@@ -33,8 +33,7 @@ Rectangle {
33 function reset() {
33 function reset() {
34 clear();
34 clear();
35 var component = Qt.createComponent("IndicatorsList.qml");
35 var component = Qt.createComponent("IndicatorsList.qml");
36− var page = component.createObject(pages);
36+ var page = component.createObject(pages, {"profile": indicatorProfile});
37− console.log(component.errorString());
38 push(page);
37 push(page);
39 }
38 }
40 }
39 }
qml/Panel/Indicators/client/IndicatorsList.qml+2−1
@@ -26,12 +26,13 @@ import "../.."
26Page {
26Page {
27 id: page
27 id: page
28 anchors.fill: parent
28 anchors.fill: parent
29+ property string profile: ""
29 title: "Plugin list"
30 title: "Plugin list"
30
31
31 Indicators.IndicatorsModel {
32 Indicators.IndicatorsModel {
32 id: indicatorsModel
33 id: indicatorsModel
33
34
34− Component.onCompleted: load()
35+ Component.onCompleted: load(profile)
35 }
36 }
36
37
37 ListView {
38 ListView {
src/Panel/Indicators/client/indicatorsclient.cpp+6−1
@@ -41,9 +41,14 @@ IndicatorsClient::IndicatorsClient(int &argc, char **argv)
41 prependImportPaths(m_view->engine(), ::overrideImportPaths());
41 prependImportPaths(m_view->engine(), ::overrideImportPaths());
42 appendImportPaths(m_view->engine(), ::fallbackImportPaths());
42 appendImportPaths(m_view->engine(), ::fallbackImportPaths());
43
43
44+ QString profile = "phone";
45+ if (args.contains(QLatin1String("-profile")) && args.size() > args.indexOf(QLatin1String("-profile")) + 1) {
46+ profile = args.at(args.indexOf(QLatin1String("-profile")) + 1);
47+ }
48+ m_view->rootContext()->setContextProperty("indicatorProfile", profile);
49+
44 m_view->setSource(QUrl("IndicatorsClient.qml"));
50 m_view->setSource(QUrl("IndicatorsClient.qml"));
45 m_view->setResizeMode(QQuickView::SizeRootObjectToView);
51 m_view->setResizeMode(QQuickView::SizeRootObjectToView);
46−
47 if (args.contains(QLatin1String("-geometry")) && args.size() > args.indexOf(QLatin1String("-geometry")) + 1) {
52 if (args.contains(QLatin1String("-geometry")) && args.size() > args.indexOf(QLatin1String("-geometry")) + 1) {
48 QStringList geometryArg = args.at(args.indexOf(QLatin1String("-geometry")) + 1).split('x');
53 QStringList geometryArg = args.at(args.indexOf(QLatin1String("-geometry")) + 1).split('x');
49 if (geometryArg.size() == 2) {
54 if (geometryArg.size() == 2) {
tests/data/unity/indicators/com.canonical.indicator.fake1+4−4
@@ -3,8 +3,8 @@ Name=indicator-fake1
3ObjectPath=/com/canonical/indicator/fake1
3ObjectPath=/com/canonical/indicator/fake1
4Position=1
4Position=1
5
5
6−[phone]
6+[test1]
7−ObjectPath=/com/canonical/indicator/fake1/phone
7+ObjectPath=/com/canonical/indicator/fake1/test1
8
8
9−[desktop]
9+[test2]
10−ObjectPath=/com/canonical/indicator/fake1/desktop
10+ObjectPath=/com/canonical/indicator/fake1/test2
tests/data/unity/indicators/com.canonical.indicator.fake2+4−4
@@ -3,8 +3,8 @@ Name=indicator-fake2
3ObjectPath=/com/canonical/indicator/fake2
3ObjectPath=/com/canonical/indicator/fake2
4Position=0
4Position=0
5
5
6−[phone]
6+[test1]
7−ObjectPath=/com/canonical/indicator/fake2/phone
7+ObjectPath=/com/canonical/indicator/fake2/test1
8
8
9−[desktop]
9+[test2]
10−ObjectPath=/com/canonical/indicator/fake2/desktop
10+ObjectPath=/com/canonical/indicator/fake2/test2
tests/data/unity/indicators/com.canonical.indicator.fake3+4−4
@@ -3,8 +3,8 @@ Name=indicator-fake3
3ObjectPath=/com/canonical/indicator/fake3
3ObjectPath=/com/canonical/indicator/fake3
4Position=3
4Position=3
5
5
6−[phone]
6+[test1]
7−ObjectPath=/com/canonical/indicator/fake3/phone
7+ObjectPath=/com/canonical/indicator/fake3/test1
8
8
9−[desktop]
9+[test2]
10−ObjectPath=/com/canonical/indicator/fake3/desktop
10+ObjectPath=/com/canonical/indicator/fake3/test2
tests/data/unity/indicators/com.canonical.indicator.fake4+4−4
@@ -3,8 +3,8 @@ Name=indicator-fake4
3ObjectPath=/com/canonical/indicator/fake4
3ObjectPath=/com/canonical/indicator/fake4
4Position=2
4Position=2
5
5
6−[phone]
6+[test1]
7−ObjectPath=/com/canonical/indicator/fake4/phone
7+ObjectPath=/com/canonical/indicator/fake4/test1
8
8
9−[desktop]
9+[test2]
10−ObjectPath=/com/canonical/indicator/fake4/desktop
10+ObjectPath=/com/canonical/indicator/fake4/test2
tests/plugins/Unity/Indicators/indicatorsmanagertest.cpp+29−6
@@ -50,7 +50,7 @@ private Q_SLOTS:
50 QVERIFY(!manager.isLoaded());
50 QVERIFY(!manager.isLoaded());
51 QCOMPARE(manager.indicators().count(), 0);
51 QCOMPARE(manager.indicators().count(), 0);
52
52
53− manager.load();
53+ manager.load("test1");
54
54
55 QVERIFY(manager.isLoaded());
55 QVERIFY(manager.isLoaded());
56 QCOMPARE(manager.indicators().count(), 4);
56 QCOMPARE(manager.indicators().count(), 4);
@@ -64,10 +64,10 @@ private Q_SLOTS:
64 /*
64 /*
65 * Test the creation & initialising of the indicator data
65 * Test the creation & initialising of the indicator data
66 */
66 */
67− void testPluginInterface()
67+ void testPluginInterfaceProfile1()
68 {
68 {
69 IndicatorsManager manager;
69 IndicatorsManager manager;
70− manager.load();
70+ manager.load("test1");
71
71
72 Indicator::Ptr indicator = manager.indicator("indicator-fake1");
72 Indicator::Ptr indicator = manager.indicator("indicator-fake1");
73 QVERIFY(indicator ? true : false);
73 QVERIFY(indicator ? true : false);
@@ -81,7 +81,30 @@ private Q_SLOTS:
81 QCOMPARE(props["busName"].toString(), QString("com.canonical.indicator.fake1"));
81 QCOMPARE(props["busName"].toString(), QString("com.canonical.indicator.fake1"));
82 QCOMPARE(props["actionsObjectPath"].toString(), QString("/com/canonical/indicator/fake1"));
82 QCOMPARE(props["actionsObjectPath"].toString(), QString("/com/canonical/indicator/fake1"));
83
83
84− QCOMPARE(props["menuObjectPath"].toString(), QString("/com/canonical/indicator/fake1/phone"));
84+ QCOMPARE(props["menuObjectPath"].toString(), QString("/com/canonical/indicator/fake1/test1"));
85+ }
86+
87+ /*
88+ * Test the creation & initialising of the indicator data
89+ */
90+ void testPluginInterfaceProfile2()
91+ {
92+ IndicatorsManager manager;
93+ manager.load("test2");
94+
95+ Indicator::Ptr indicator = manager.indicator("indicator-fake1");
96+ QVERIFY(indicator ? true : false);
97+
98+ QCOMPARE(indicator->identifier(), QString("indicator-fake1"));
99+ QCOMPARE(indicator->position(), 1);
100+
101+ // Check that the initial properties have been set.
102+ QVariantMap props = indicator->indicatorProperties().toMap();
103+ QCOMPARE(props.count(), 4);
104+ QCOMPARE(props["busName"].toString(), QString("com.canonical.indicator.fake1"));
105+ QCOMPARE(props["actionsObjectPath"].toString(), QString("/com/canonical/indicator/fake1"));
106+
107+ QCOMPARE(props["menuObjectPath"].toString(), QString("/com/canonical/indicator/fake1/test2"));
85 }
108 }
86
109
87 /*
110 /*
@@ -90,7 +113,7 @@ private Q_SLOTS:
90 void testPluginInstance()
113 void testPluginInstance()
91 {
114 {
92 IndicatorsManager manager;
115 IndicatorsManager manager;
93− manager.load();
116+ manager.load("test2");
94
117
95 Indicator::Ptr i0 = manager.indicator("indicator-fake1");
118 Indicator::Ptr i0 = manager.indicator("indicator-fake1");
96 Indicator::Ptr i1 = manager.indicator("indicator-fake1");
119 Indicator::Ptr i1 = manager.indicator("indicator-fake1");
@@ -110,7 +133,7 @@ private Q_SLOTS:
110 void testPluginInitAndShutdown()
133 void testPluginInitAndShutdown()
111 {
134 {
112 IndicatorsManager manager;
135 IndicatorsManager manager;
113− manager.load();
136+ manager.load("test1");
114
137
115 QWeakPointer<Indicator> wp0;
138 QWeakPointer<Indicator> wp0;
116 QWeakPointer<Indicator> wp1;
139 QWeakPointer<Indicator> wp1;
tests/plugins/Unity/Indicators/indicatorsmodeltest.cpp+49−4
@@ -50,7 +50,7 @@ private Q_SLOTS:
50
50
51 QCOMPARE(model.property("count").toInt(), 0);
51 QCOMPARE(model.property("count").toInt(), 0);
52
52
53− model.load();
53+ model.load("test1");
54
54
55 QCOMPARE(model.property("count").toInt(), 4);
55 QCOMPARE(model.property("count").toInt(), 4);
56
56
@@ -61,13 +61,13 @@ private Q_SLOTS:
61 }
61 }
62
62
63 /*
63 /*
64− * Testa that the plugin data was loaded correctly
64+ * Testa that the plugin data was loaded correctly ( "test1" )
65 */
65 */
66− void testDataAndOrder()
66+ void testDataAndOrderProfile1()
67 {
67 {
68 // Priority order. (2, 1, 4, 3)
68 // Priority order. (2, 1, 4, 3)
69 IndicatorsModel model;
69 IndicatorsModel model;
70− model.load();
70+ model.load("test1");
71
71
72 // should be in order:
72 // should be in order:
73 // fake3, fake4, fake1, fake2
73 // fake3, fake4, fake1, fake2
@@ -75,18 +75,63 @@ private Q_SLOTS:
75 QCOMPARE(model.data(0, IndicatorsModelRole::Identifier).toString(), QString("indicator-fake3"));
75 QCOMPARE(model.data(0, IndicatorsModelRole::Identifier).toString(), QString("indicator-fake3"));
76 QCOMPARE(model.data(0, IndicatorsModelRole::Position).toInt(), 3);
76 QCOMPARE(model.data(0, IndicatorsModelRole::Position).toInt(), 3);
77 QCOMPARE(model.data(0, IndicatorsModelRole::IndicatorProperties).toMap()["busName"].toString(), QString("com.canonical.indicator.fake3"));
77 QCOMPARE(model.data(0, IndicatorsModelRole::IndicatorProperties).toMap()["busName"].toString(), QString("com.canonical.indicator.fake3"));
78+ QCOMPARE(model.data(0, IndicatorsModelRole::IndicatorProperties).toMap()["actionsObjectPath"].toString(), QString("/com/canonical/indicator/fake3"));
79+ QCOMPARE(model.data(0, IndicatorsModelRole::IndicatorProperties).toMap()["menuObjectPath"].toString(), QString("/com/canonical/indicator/fake3/test1"));
78
80
79 QCOMPARE(model.data(1, IndicatorsModelRole::Identifier).toString(), QString("indicator-fake4"));
81 QCOMPARE(model.data(1, IndicatorsModelRole::Identifier).toString(), QString("indicator-fake4"));
80 QCOMPARE(model.data(1, IndicatorsModelRole::Position).toInt(), 2);
82 QCOMPARE(model.data(1, IndicatorsModelRole::Position).toInt(), 2);
81 QCOMPARE(model.data(1, IndicatorsModelRole::IndicatorProperties).toMap()["busName"].toString(), QString("com.canonical.indicator.fake4"));
83 QCOMPARE(model.data(1, IndicatorsModelRole::IndicatorProperties).toMap()["busName"].toString(), QString("com.canonical.indicator.fake4"));
84+ QCOMPARE(model.data(1, IndicatorsModelRole::IndicatorProperties).toMap()["actionsObjectPath"].toString(), QString("/com/canonical/indicator/fake4"));
85+ QCOMPARE(model.data(1, IndicatorsModelRole::IndicatorProperties).toMap()["menuObjectPath"].toString(), QString("/com/canonical/indicator/fake4/test1"));
82
86
83 QCOMPARE(model.data(2, IndicatorsModelRole::Identifier).toString(), QString("indicator-fake1"));
87 QCOMPARE(model.data(2, IndicatorsModelRole::Identifier).toString(), QString("indicator-fake1"));
84 QCOMPARE(model.data(2, IndicatorsModelRole::Position).toInt(), 1);
88 QCOMPARE(model.data(2, IndicatorsModelRole::Position).toInt(), 1);
85 QCOMPARE(model.data(2, IndicatorsModelRole::IndicatorProperties).toMap()["busName"].toString(), QString("com.canonical.indicator.fake1"));
89 QCOMPARE(model.data(2, IndicatorsModelRole::IndicatorProperties).toMap()["busName"].toString(), QString("com.canonical.indicator.fake1"));
90+ QCOMPARE(model.data(2, IndicatorsModelRole::IndicatorProperties).toMap()["actionsObjectPath"].toString(), QString("/com/canonical/indicator/fake1"));
91+ QCOMPARE(model.data(2, IndicatorsModelRole::IndicatorProperties).toMap()["menuObjectPath"].toString(), QString("/com/canonical/indicator/fake1/test1"));
86
92
87 QCOMPARE(model.data(3, IndicatorsModelRole::Identifier).toString(), QString("indicator-fake2"));
93 QCOMPARE(model.data(3, IndicatorsModelRole::Identifier).toString(), QString("indicator-fake2"));
88 QCOMPARE(model.data(3, IndicatorsModelRole::Position).toInt(), 0);
94 QCOMPARE(model.data(3, IndicatorsModelRole::Position).toInt(), 0);
89 QCOMPARE(model.data(3, IndicatorsModelRole::IndicatorProperties).toMap()["busName"].toString(), QString("com.canonical.indicator.fake2"));
95 QCOMPARE(model.data(3, IndicatorsModelRole::IndicatorProperties).toMap()["busName"].toString(), QString("com.canonical.indicator.fake2"));
96+ QCOMPARE(model.data(3, IndicatorsModelRole::IndicatorProperties).toMap()["actionsObjectPath"].toString(), QString("/com/canonical/indicator/fake2"));
97+ QCOMPARE(model.data(3, IndicatorsModelRole::IndicatorProperties).toMap()["menuObjectPath"].toString(), QString("/com/canonical/indicator/fake2/test1"));
98+ }
99+
100+ /*
101+ * Testa that the plugin data was loaded correctly ( "test2" )
102+ */
103+ void testDataAndOrderProfile2()
104+ {
105+ // Priority order. (2, 1, 4, 3)
106+ IndicatorsModel model;
107+ model.load("test2");
108+
109+ // should be in order:
110+ // fake3, fake4, fake1, fake2
111+
112+ QCOMPARE(model.data(0, IndicatorsModelRole::Identifier).toString(), QString("indicator-fake3"));
113+ QCOMPARE(model.data(0, IndicatorsModelRole::Position).toInt(), 3);
114+ QCOMPARE(model.data(0, IndicatorsModelRole::IndicatorProperties).toMap()["busName"].toString(), QString("com.canonical.indicator.fake3"));
115+ QCOMPARE(model.data(0, IndicatorsModelRole::IndicatorProperties).toMap()["actionsObjectPath"].toString(), QString("/com/canonical/indicator/fake3"));
116+ QCOMPARE(model.data(0, IndicatorsModelRole::IndicatorProperties).toMap()["menuObjectPath"].toString(), QString("/com/canonical/indicator/fake3/test2"));
117+
118+ QCOMPARE(model.data(1, IndicatorsModelRole::Identifier).toString(), QString("indicator-fake4"));
119+ QCOMPARE(model.data(1, IndicatorsModelRole::Position).toInt(), 2);
120+ QCOMPARE(model.data(1, IndicatorsModelRole::IndicatorProperties).toMap()["busName"].toString(), QString("com.canonical.indicator.fake4"));
121+ QCOMPARE(model.data(1, IndicatorsModelRole::IndicatorProperties).toMap()["actionsObjectPath"].toString(), QString("/com/canonical/indicator/fake4"));
122+ QCOMPARE(model.data(1, IndicatorsModelRole::IndicatorProperties).toMap()["menuObjectPath"].toString(), QString("/com/canonical/indicator/fake4/test2"));
123+
124+ QCOMPARE(model.data(2, IndicatorsModelRole::Identifier).toString(), QString("indicator-fake1"));
125+ QCOMPARE(model.data(2, IndicatorsModelRole::Position).toInt(), 1);
126+ QCOMPARE(model.data(2, IndicatorsModelRole::IndicatorProperties).toMap()["busName"].toString(), QString("com.canonical.indicator.fake1"));
127+ QCOMPARE(model.data(2, IndicatorsModelRole::IndicatorProperties).toMap()["actionsObjectPath"].toString(), QString("/com/canonical/indicator/fake1"));
128+ QCOMPARE(model.data(2, IndicatorsModelRole::IndicatorProperties).toMap()["menuObjectPath"].toString(), QString("/com/canonical/indicator/fake1/test2"));
129+
130+ QCOMPARE(model.data(3, IndicatorsModelRole::Identifier).toString(), QString("indicator-fake2"));
131+ QCOMPARE(model.data(3, IndicatorsModelRole::Position).toInt(), 0);
132+ QCOMPARE(model.data(3, IndicatorsModelRole::IndicatorProperties).toMap()["busName"].toString(), QString("com.canonical.indicator.fake2"));
133+ QCOMPARE(model.data(3, IndicatorsModelRole::IndicatorProperties).toMap()["actionsObjectPath"].toString(), QString("/com/canonical/indicator/fake2"));
134+ QCOMPARE(model.data(3, IndicatorsModelRole::IndicatorProperties).toMap()["menuObjectPath"].toString(), QString("/com/canonical/indicator/fake2/test2"));
90 }
135 }
91};
136};
92
137
tests/qmltests/Panel/tst_IndicatorRow.qml+2−2
@@ -32,7 +32,7 @@ Item {
32
32
33 function init_test()
33 function init_test()
34 {
34 {
35− indicatorModel.load();
35+ indicatorModel.load("test1");
36
36
37 indicatorRow.state = "initial";
37 indicatorRow.state = "initial";
38 indicatorRow.setCurrentItemIndex(-1);
38 indicatorRow.setCurrentItemIndex(-1);
@@ -52,7 +52,7 @@ Item {
52
52
53 indicatorsModel: indicatorModel
53 indicatorsModel: indicatorModel
54
54
55− Component.onCompleted: indicatorModel.load()
55+ Component.onCompleted: indicatorModel.load("test1")
56 }
56 }
57
57
58 Indicators.IndicatorsModel {
58 Indicators.IndicatorsModel {
tests/qmltests/Panel/tst_Indicators.qml+1
@@ -43,6 +43,7 @@ Item {
43 width: (shell.width > units.gu(60)) ? units.gu(40) : shell.width
43 width: (shell.width > units.gu(60)) ? units.gu(40) : shell.width
44 y: 0
44 y: 0
45 shown: false
45 shown: false
46+ profile: "test1"
46
47
47 openedHeight: parent.height - click_me.height
48 openedHeight: parent.height - click_me.height
48 }
49 }
tests/qmltests/Panel/tst_MenuContent.qml+1−1
@@ -41,7 +41,7 @@ Item {
41
41
42 Indicators.IndicatorsModel {
42 Indicators.IndicatorsModel {
43 id: indicatorsModel
43 id: indicatorsModel
44− Component.onCompleted: load()
44+ Component.onCompleted: load("test1")
45 }
45 }
46
46
47 MenuContent {
47 MenuContent {
tests/qmltests/Panel/tst_Panel.qml+4
@@ -40,6 +40,10 @@ Item {
40 Panel {
40 Panel {
41 id: panel
41 id: panel
42 anchors.fill: parent
42 anchors.fill: parent
43+
44+ indicators {
45+ profile: "test1"
46+ }
43 }
47 }
44
48
45 UT.UnityTestCase {
49 UT.UnityTestCase {