on xenial help sign in
review comments
2e1beb4Nick Dedekind
Panel/Indicators/NetworkIndicatorWidget.qml+1−1
@@ -40,7 +40,7 @@ Indicators.IndicatorWidget {
40 anchors.centerIn: parent
40 anchors.centerIn: parent
41 }
41 }
42
42
43− function parseRootElement(type, data) {
43+ function parseRootElement(type) {
44 if (type == "com.canonical.indicator.root.network") {
44 if (type == "com.canonical.indicator.root.network") {
45 return true;
45 return true;
46 }
46 }
Panel/Menus/Overview/OverviewGrid.qml−1
@@ -56,7 +56,6 @@ Item {
56 interactive: false
56 interactive: false
57 delegate:
57 delegate:
58 AbstractButton {
58 AbstractButton {
59− id: indicatorButton
60 objectName: "overviewGridButton" + index
59 objectName: "overviewGridButton" + index
61 width: grid.cellWidth
60 width: grid.cellWidth
62 height: grid.cellHeight
61 height: grid.cellHeight
debian/control+2−3
@@ -67,9 +67,8 @@ Depends: qmenumodel-qml,
67 unity8 (= ${source:Version}),
67 unity8 (= ${source:Version}),
68 ${misc:Depends},
68 ${misc:Depends},
69 ${shlibs:Depends},
69 ${shlibs:Depends},
70−Description: Indicators and system settings client application
70+Description: Indicators client test application
71− This package contains the client application for indicators and system
71+ This package contains the client application for indicators used by autopilot
72− settings.
73
72
74Package: unity8-fake-env
73Package: unity8-fake-env
75Replaces: qml-phone-shell-fake-env (<< 7.80~)
74Replaces: qml-phone-shell-fake-env (<< 7.80~)
modules/Unity/Indicators/Network/plugin.cpp+1−1
@@ -13,7 +13,7 @@
13 * You should have received a copy of the GNU General Public License
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
15 *
16− * Author: Michał Sawicz <michal.sawicz@canonical.com>
16+ * Author: Nick Dedekind <nick.dedekind@canonical.com>
17 */
17 */
18
18
19// Qt
19// Qt
modules/Unity/Indicators/flatmenuproxymodel.cpp+3−67
@@ -220,60 +220,6 @@ void FlatMenuProxyModel::onModelReset()
220 Q_EMIT countChanged();
220 Q_EMIT countChanged();
221}
221}
222
222
223−// void FlatMenuProxyModel::onRowsAboutToBeInserted(const QModelIndex &index, int first, int last)
224−// {
225−// if (index.isValid()) {
226−// int firstIndex = rowOffsetOf(index, first);
227−// int lastIndex = rowOffsetOf(index, last, true);
228−
229−// beginInsertRows(QModelIndex(), firstIndex, lastIndex);
230−// m_rowCount += (lastIndex - firstIndex + 1);
231−// }
232−// }
233−
234−// void FlatMenuProxyModel::onRowsAboutToBeRemoved(const QModelIndex &index, int first, int last)
235−// {
236−// if (index.isValid()) {
237−// int firstIndex = rowOffsetOf(index, first);
238−// int lastIndex = rowOffsetOf(index, last, true);
239−
240−// m_indexCache.clear();
241−// beginRemoveRows(QModelIndex(), firstIndex, lastIndex);
242−// m_rowCount -= (lastIndex - firstIndex + 1);
243−// }
244−// }
245−
246−// void FlatMenuProxyModel::onRowsInserted(const QModelIndex &index, int first, int last)
247−// {
248−// if (index.isValid()) {
249−// m_indexCache.clear();
250−// endInsertRows();
251−// for (int i=first; i <= last; i++) {
252−// QModelIndex subIndex = sourceModel()->index(i, 0, index.parent());
253−// if (subIndex.isValid()) {
254−// int subSectionSize = recursiveRowCount(subIndex);
255−// if (subSectionSize > 0) {
256−// int firstIndex = rowOffsetOf(index, i) + 1;
257−// int lastIndex = rowOffsetOf(index, i, true);
258−
259−// beginInsertRows(QModelIndex(), firstIndex, lastIndex);
260−// m_rowCount += lastIndex - firstIndex + 1;
261−// endInsertRows();
262−// }
263−// }
264−// }
265−// }
266−// Q_EMIT countChanged();
267−// }
268−
269−// void FlatMenuProxyModel::onRowsRemoved(const QModelIndex &index, int, int)
270−// {
271−// if (index.isValid()) {
272−// endRemoveRows();
273−// Q_EMIT countChanged();
274−// }
275−// }
276−
277int FlatMenuProxyModel::recursiveRowCount(const QModelIndex &index) const
223int FlatMenuProxyModel::recursiveRowCount(const QModelIndex &index) const
278{
224{
279 int size = sourceModel()->rowCount(index);
225 int size = sourceModel()->rowCount(index);
@@ -316,17 +262,7 @@ int FlatMenuProxyModel::rowOffsetOf(const QModelIndex &index, int row, bool incl
316 return offset;
262 return offset;
317}
263}
318
264
319−/*! \for use in qml */
320−QVariantMap FlatMenuProxyModel::get(int row) const
265+QVariant FlatMenuProxyModel::data(int row, int role) const
321{
266{
322− QVariantMap result;
267+ return QAbstractProxyModel::data(index(row, 0), role);
323−
324− QModelIndex index = this->index(row);
325− if (index.isValid()) {
326− const QHash<int, QByteArray> roleNames = this->roleNames();
327− Q_FOREACH(int i, roleNames.keys()) {
328− result.insert(roleNames[i], data(index, i));
329− }
330− }
331− return result;
332−}
268+}
modules/Unity/Indicators/flatmenuproxymodel.h+13−9
@@ -34,12 +34,25 @@ class FlatMenuProxyModel : public QAbstractProxyModel
34 Q_PROPERTY(QString objectPath READ objectPath WRITE setObjectPath NOTIFY objectPathChanged)
34 Q_PROPERTY(QString objectPath READ objectPath WRITE setObjectPath NOTIFY objectPathChanged)
35 Q_PROPERTY(int status READ status NOTIFY statusChanged)
35 Q_PROPERTY(int status READ status NOTIFY statusChanged)
36
36
37+ Q_ENUMS(Roles)
37public:
38public:
39+ // Because this is a proxy to qmenumodel, it may change.
40+ enum Roles {
41+ Action = Qt::DisplayRole + 1,
42+ Label,
43+ Extra,
44+ Depth,
45+ hasSection,
46+ hasSubMenu
47+ };
48+
38 FlatMenuProxyModel(QAbstractItemModel *source=0);
49 FlatMenuProxyModel(QAbstractItemModel *source=0);
39 ~FlatMenuProxyModel();
50 ~FlatMenuProxyModel();
40
51
41 void setSourceModel(QAbstractItemModel * sourceModel);
52 void setSourceModel(QAbstractItemModel * sourceModel);
42
53
54+ Q_INVOKABLE QVariant data(int row, int role = Qt::DisplayRole) const;
55+
43 QModelIndex mapFromSource(const QModelIndex &index) const;
56 QModelIndex mapFromSource(const QModelIndex &index) const;
44 QModelIndex mapToSource(const QModelIndex &index) const;
57 QModelIndex mapToSource(const QModelIndex &index) const;
45
58
@@ -60,16 +73,7 @@ public:
60
73
61 int status() const;
74 int status() const;
62
75
63− /* QML */
64− Q_INVOKABLE QVariantMap get(int row) const;
65−
66public Q_SLOTS:
76public Q_SLOTS:
67− // void onRowsInserted(const QModelIndex &parent, int start, int end);
68− // void onRowsAboutToBeInserted(const QModelIndex &parent, int start, int end);
69−
70− // void onRowsRemoved(const QModelIndex &parent, int start, int end);
71− // void onRowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
72−
73 void onModelAboutToBeReset();
77 void onModelAboutToBeReset();
74 void onModelReset();
78 void onModelReset();
75
79
modules/Unity/Indicators/indicator.h−1
@@ -23,7 +23,6 @@
23
23
24#include <QObject>
24#include <QObject>
25#include <QSettings>
25#include <QSettings>
26−#include <memory>
27
26
28class Indicator : public QObject
27class Indicator : public QObject
29{
28{
modules/Unity/Indicators/indicatorsmanager.cpp+28−19
@@ -1,9 +1,6 @@
1/*
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
3 *
4− * Authors:
5− * Michał Sawicz <michal.sawicz@canonical.com>
6− *
7 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 3.
6 * the Free Software Foundation; version 3.
@@ -15,6 +12,8 @@
15 *
12 *
16 * You should have received a copy of the GNU General Public License
13 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ *
16+ * Author: Nick Dedekind <nick.dedekind@canonical.com>
18 */
17 */
19
18
20#include "indicatorsmanager.h"
19#include "indicatorsmanager.h"
@@ -29,9 +28,9 @@ class IndicatorsManager::IndicatorData
29{
28{
30public:
29public:
31 IndicatorData(const QString& name, const QFileInfo& fileInfo)
30 IndicatorData(const QString& name, const QFileInfo& fileInfo)
32− : m_name(name)
31+ : m_name(name)
33− , m_fileInfo(fileInfo)
32+ , m_fileInfo(fileInfo)
34− , m_verified (true)
33+ , m_verified (true)
35 {}
34 {}
36
35
37 QString m_name;
36 QString m_name;
@@ -42,8 +41,8 @@ public:
42};
41};
43
42
44IndicatorsManager::IndicatorsManager(QObject* parent)
43IndicatorsManager::IndicatorsManager(QObject* parent)
45−: QObject(parent)
44+ : QObject(parent)
46−, m_loaded(false)
45+ , m_loaded(false)
47{
46{
48}
47}
49
48
@@ -68,7 +67,7 @@ void IndicatorsManager::load()
68 // watch folder for changes.
67 // watch folder for changes.
69 m_fsWatcher->addPath(indicator_path);
68 m_fsWatcher->addPath(indicator_path);
70
69
71− load(indicator_dir);
70+ loadDir(indicator_dir);
72 }
71 }
73 }
72 }
74
73
@@ -77,9 +76,9 @@ void IndicatorsManager::load()
77 setLoaded(true);
76 setLoaded(true);
78}
77}
79
78
80−void IndicatorsManager::onDirectoryChanged(const QString& direcory)
79+void IndicatorsManager::onDirectoryChanged(const QString& directory)
81{
80{
82− load(QDir(direcory));
81+ loadDir(QDir(directory));
83}
82}
84
83
85void IndicatorsManager::onFileChanged(const QString& file)
84void IndicatorsManager::onFileChanged(const QString& file)
@@ -87,29 +86,29 @@ void IndicatorsManager::onFileChanged(const QString& file)
87 QFileInfo file_info(file);
86 QFileInfo file_info(file);
88 if (!file_info.exists())
87 if (!file_info.exists())
89 {
88 {
90− unload(file_info);
89+ unloadFile(file_info);
91 return;
90 return;
92 }
91 }
93 else
92 else
94 {
93 {
95− load(QFileInfo(file));
94+ loadFile(QFileInfo(file));
96 }
95 }
97}
96}
98
97
99−void IndicatorsManager::load(const QDir& dir)
98+void IndicatorsManager::loadDir(const QDir& dir)
100{
99{
101 startVerify(dir.canonicalPath());
100 startVerify(dir.canonicalPath());
102
101
103 QFileInfoList indicator_files = dir.entryInfoList(QStringList(), QDir::Files|QDir::NoDotAndDotDot);
102 QFileInfoList indicator_files = dir.entryInfoList(QStringList(), QDir::Files|QDir::NoDotAndDotDot);
104 Q_FOREACH(const QFileInfo& indicator_file, indicator_files)
103 Q_FOREACH(const QFileInfo& indicator_file, indicator_files)
105 {
104 {
106− load(indicator_file);
105+ loadFile(indicator_file);
107 }
106 }
108
107
109 endVerify(dir.canonicalPath());
108 endVerify(dir.canonicalPath());
110}
109}
111
110
112−void IndicatorsManager::load(const QFileInfo& file_info)
111+void IndicatorsManager::loadFile(const QFileInfo& file_info)
113{
112{
114 QSettings indicator_settings(file_info.absoluteFilePath(), QSettings::IniFormat, this);
113 QSettings indicator_settings(file_info.absoluteFilePath(), QSettings::IniFormat, this);
115 QString name = indicator_settings.value("Indicator Service/Name").toString();
114 QString name = indicator_settings.value("Indicator Service/Name").toString();
@@ -128,18 +127,24 @@ void IndicatorsManager::load(const QFileInfo& file_info)
128
127
129 // if we've already got this indicator, we need to make sure we're not overwriting data which is
128 // if we've already got this indicator, we need to make sure we're not overwriting data which is
130 // from a lower priority standard path
129 // from a lower priority standard path
131− QStringList xdgLocations = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
130+ QStringList xdgLocations = shellDataDirs();
132 for (int i = 0; i < xdgLocations.size(); i++)
131 for (int i = 0; i < xdgLocations.size(); i++)
133 {
132 {
134 QString indicatorDir = QDir::cleanPath(xdgLocations[i] + "/unity/indicators");
133 QString indicatorDir = QDir::cleanPath(xdgLocations[i] + "/unity/indicators");
135
134
136 if (newFileInfoDir == indicatorDir)
135 if (newFileInfoDir == indicatorDir)
136+ {
137− file_info_location = i;
137+ file_info_location = i;
138+ }
138 if (currentDataDir == indicatorDir)
139 if (currentDataDir == indicatorDir)
140+ {
139 current_data_location = i;
141 current_data_location = i;
142+ }
140
143
141 if (file_info_location != -1 && current_data_location != -1)
144 if (file_info_location != -1 && current_data_location != -1)
145+ {
142 break;
146 break;
147+ }
143 }
148 }
144
149
145 // file location is higher (or of equal) priority. overwrite.
150 // file location is higher (or of equal) priority. overwrite.
@@ -174,7 +179,7 @@ void IndicatorsManager::unload()
174 setLoaded(false);
179 setLoaded(false);
175}
180}
176
181
177−void IndicatorsManager::unload(const QFileInfo& file)
182+void IndicatorsManager::unloadFile(const QFileInfo& file)
178{
183{
179 QMutableHashIterator<QString, IndicatorData*> iter(m_indicatorsData);
184 QMutableHashIterator<QString, IndicatorData*> iter(m_indicatorsData);
180 while(iter.hasNext())
185 while(iter.hasNext())
@@ -214,7 +219,9 @@ void IndicatorsManager::startVerify(const QString& path)
214 iter.next();
219 iter.next();
215 IndicatorData* data = iter.value();
220 IndicatorData* data = iter.value();
216 if (data->m_fileInfo.canonicalPath() == path)
221 if (data->m_fileInfo.canonicalPath() == path)
222+ {
217 data->m_verified = false;
223 data->m_verified = false;
224+ }
218 }
225 }
219}
226}
220
227
@@ -249,7 +256,9 @@ Indicator::Ptr IndicatorsManager::indicator(const QString& indicator)
249
256
250 IndicatorData *data = m_indicatorsData[indicator];
257 IndicatorData *data = m_indicatorsData[indicator];
251 if (data->m_indicator)
258 if (data->m_indicator)
259+ {
252 return data->m_indicator;
260 return data->m_indicator;
261+ }
253
262
254 Indicator::Ptr plugin(new Indicator(this));
263 Indicator::Ptr plugin(new Indicator(this));
255 data->m_indicator = plugin;
264 data->m_indicator = plugin;
modules/Unity/Indicators/indicatorsmanager.h+6−8
@@ -1,9 +1,6 @@
1/*
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
3 *
4− * Authors:
5− * Michał Sawicz <michal.sawicz@canonical.com>
6− *
7 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 3.
6 * the Free Software Foundation; version 3.
@@ -15,9 +12,10 @@
15 *
12 *
16 * You should have received a copy of the GNU General Public License
13 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ *
16+ * Author: Nick Dedekind <nick.dedekind@canonical.com>
18 */
17 */
19
18
20−
21#ifndef INDICATORS_MANAGER_H
19#ifndef INDICATORS_MANAGER_H
22#define INDICATORS_MANAGER_H
20#define INDICATORS_MANAGER_H
23
21
@@ -53,13 +51,13 @@ Q_SIGNALS:
53 void indicatorAboutToBeUnloaded(const QString& indicator);
51 void indicatorAboutToBeUnloaded(const QString& indicator);
54
52
55private Q_SLOTS:
53private Q_SLOTS:
56− void onDirectoryChanged(const QString& direcory);
54+ void onDirectoryChanged(const QString& directory);
57 void onFileChanged(const QString& file);
55 void onFileChanged(const QString& file);
58
56
59private:
57private:
60− void load(const QDir& dir);
58+ void loadDir(const QDir& dir);
61− void load(const QFileInfo& file);
59+ void loadFile(const QFileInfo& file);
62− void unload(const QFileInfo& dir);
60+ void unloadFile(const QFileInfo& dir);
63
61
64 void startVerify(const QString& path);
62 void startVerify(const QString& path);
65 void endVerify(const QString& path);
63 void endVerify(const QString& path);
modules/Unity/Indicators/indicatorsmodel.cpp+5−21
@@ -67,27 +67,6 @@ IndicatorsModel::~IndicatorsModel()
67 m_manager->deleteLater();
67 m_manager->deleteLater();
68}
68}
69
69
70−/*!
71− \qmlmethod IndicatorsModel::get(int)
72−
73− Returns the item at index in the model. This allows the item data to be accessed from JavaScript:
74− \b Note: methods should only be called after the Component has completed.
75−*/
76−QVariantMap IndicatorsModel::get(int row) const
77−{
78− QVariantMap result;
79−
80− QModelIndex index = this->index(row);
81− if (index.isValid()) {
82− QMap<int, QVariant> data = itemData(index);
83− const QHash<int, QByteArray> roleNames = this->roleNames();
84− Q_FOREACH(int i, roleNames.keys()) {
85− result.insert(roleNames[i], data[i]);
86− }
87− }
88− return result;
89−}
90−
91/*!
70/*!
92 \qmlproperty IndicatorsModel::count
71 \qmlproperty IndicatorsModel::count
93 The number of data entries in the model.
72 The number of data entries in the model.
@@ -246,6 +225,11 @@ QVariant IndicatorsModel::defaultData(Indicator::Ptr plugin, int role)
246 return QVariant();
225 return QVariant();
247}
226}
248
227
228+Q_INVOKABLE QVariant IndicatorsModel::data(int row, int role) const
229+{
230+ return data(index(row, 0), role);
231+}
232+
249/*! \internal */
233/*! \internal */
250QVariant IndicatorsModel::data(const QModelIndex &index, int role) const
234QVariant IndicatorsModel::data(const QModelIndex &index, int role) const
251{
235{
modules/Unity/Indicators/indicatorsmodel.h+1−1
@@ -53,7 +53,7 @@ public:
53 Q_INVOKABLE void load();
53 Q_INVOKABLE void load();
54 Q_INVOKABLE void unload();
54 Q_INVOKABLE void unload();
55
55
56− Q_INVOKABLE QVariantMap get(int row) const;
56+ Q_INVOKABLE QVariant data(int row, int role = Qt::DisplayRole) const;
57
57
58 /* QAbstractItemModel */
58 /* QAbstractItemModel */
59 QHash<int, QByteArray> roleNames() const;
59 QHash<int, QByteArray> roleNames() const;
modules/Unity/Indicators/plugin.cpp+1−1
@@ -13,7 +13,7 @@
13 * You should have received a copy of the GNU General Public License
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
15 *
16− * Author: Michał Sawicz <michal.sawicz@canonical.com>
16+ * Author: Nick Dedekind <nick.dedekind@canonical.com>
17 */
17 */
18
18
19// Qt
19// Qt
modules/Unity/Indicators/qml/IndicatorWidget.qml+6−6
@@ -49,21 +49,21 @@ IndicatorBase {
49
49
50
50
51 function update_state() {
51 function update_state() {
52− var data = proxyModel.get(0);
52+ var extra = proxyModel.data(0, Indicators.FlatMenuProxyModel.Extra);
53− if (data == undefined || data.extra == undefined) {
53+ if (extra == undefined) {
54 return;
54 return;
55 }
55 }
56
56
57− if (!data.extra.hasOwnProperty("canonical_type")) {
57+ if (!extra.hasOwnProperty("canonical_type")) {
58 return;
58 return;
59 }
59 }
60
60
61− if (parseRootElement(data.extra.canonical_type, data)) {
61+ if (parseRootElement(extra.canonical_type)) {
62− action = actionGroup.action(data.action);
62+ action = actionGroup.action(proxyModel.data(0, Indicators.FlatMenuProxyModel.Action));
63 }
63 }
64 }
64 }
65
65
66− function parseRootElement(type, data) {
66+ function parseRootElement(type) {
67 if (type == "com.canonical.indicator.root")
67 if (type == "com.canonical.indicator.root")
68 return true;
68 return true;
69 return false;
69 return false;
paths.h.in+2−1
@@ -75,7 +75,8 @@ inline QStringList shellDataDirs() {
75 }
75 }
76 }
76 }
77 else {
77 else {
78+ // append so by default we use xdg files.
78− dirs.prepend(shellAppDirectory());
79+ dirs.append(shellAppDirectory());
79 }
80 }
80 return dirs;
81 return dirs;
81}
82}
tests/modules/Unity/Indicators/indicatorsmodeltest.cpp+12−12
@@ -78,21 +78,21 @@ private Q_SLOTS:
78 model.setIndicatorData(map);
78 model.setIndicatorData(map);
79 model.load();
79 model.load();
80
80
81− QCOMPARE(model.get(0)["identifier"].toString(), QString("indicator-fake2"));
81+ QCOMPARE(model.data(0, IndicatorsModel::Identifier).toString(), QString("indicator-fake2"));
82− QCOMPARE(model.get(0)["title"].toString(), QString("fake2"));
82+ QCOMPARE(model.data(0, IndicatorsModel::Title).toString(), QString("fake2"));
83− QCOMPARE(model.get(0)["indicatorProperties"].toMap()["busName"].toString(), QString("com.canonical.indicator.fake2"));
83+ QCOMPARE(model.data(0, IndicatorsModel::IndicatorProperties).toMap()["busName"].toString(), QString("com.canonical.indicator.fake2"));
84
84
85− QCOMPARE(model.get(1)["identifier"].toString(), QString("indicator-fake1"));
85+ QCOMPARE(model.data(1, IndicatorsModel::Identifier).toString(), QString("indicator-fake1"));
86− QCOMPARE(model.get(1)["title"].toString(), QString("fake1"));
86+ QCOMPARE(model.data(1, IndicatorsModel::Title).toString(), QString("fake1"));
87− QCOMPARE(model.get(1)["indicatorProperties"].toMap()["busName"].toString(), QString("com.canonical.indicator.fake1"));
87+ QCOMPARE(model.data(1, IndicatorsModel::IndicatorProperties).toMap()["busName"].toString(), QString("com.canonical.indicator.fake1"));
88
88
89− QCOMPARE(model.get(2)["identifier"].toString(), QString("indicator-fake4"));
89+ QCOMPARE(model.data(2, IndicatorsModel::Identifier).toString(), QString("indicator-fake4"));
90− QCOMPARE(model.get(2)["title"].toString(), QString("fake4"));
90+ QCOMPARE(model.data(2, IndicatorsModel::Title).toString(), QString("fake4"));
91− QCOMPARE(model.get(2)["indicatorProperties"].toMap()["busName"].toString(), QString("com.canonical.indicator.fake4"));
91+ QCOMPARE(model.data(2, IndicatorsModel::IndicatorProperties).toMap()["busName"].toString(), QString("com.canonical.indicator.fake4"));
92
92
93− QCOMPARE(model.get(3)["identifier"].toString(), QString("indicator-fake3"));
93+ QCOMPARE(model.data(3, IndicatorsModel::Identifier).toString(), QString("indicator-fake3"));
94− QCOMPARE(model.get(3)["title"].toString(), QString("fake3"));
94+ QCOMPARE(model.data(3, IndicatorsModel::Title).toString(), QString("fake3"));
95− QCOMPARE(model.get(3)["indicatorProperties"].toMap()["busName"].toString(), QString("com.canonical.indicator.fake3"));
95+ QCOMPARE(model.data(3, IndicatorsModel::IndicatorProperties).toMap()["busName"].toString(), QString("com.canonical.indicator.fake3"));
96 }
96 }
97};
97};
98
98