Merge lp:~nick-dedekind/unity8/indicators-client-textual-app into lp:unity8
- indicators-client-textual-app
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Daniel d'Andrada |
Approved revision: | 101 |
Merged at revision: | 149 |
Proposed branch: | lp:~nick-dedekind/unity8/indicators-client-textual-app |
Merge into: | lp:unity8 |
Diff against target: |
414 lines (+298/-25) 8 files modified
Panel/Indicators/client/IndicatorsClient.qml (+8/-9) Panel/Indicators/client/IndicatorsPage.qml (+60/-15) Panel/Indicators/client/IndicatorsTree.qml (+62/-0) plugins/Unity/Indicators/CMakeLists.txt (+1/-0) plugins/Unity/Indicators/modelprinter.cpp (+114/-0) plugins/Unity/Indicators/modelprinter.h (+50/-0) plugins/Unity/Indicators/plugin.cpp (+2/-0) tests/autopilot/unity8/indicators_client/tests/test_battery.py (+1/-1) |
To merge this branch: | bzr merge lp:~nick-dedekind/unity8/indicators-client-textual-app |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Daniel d'Andrada (community) | Approve | ||
Michał Sawicz | Needs Fixing | ||
Review via email:
|
Commit message
Added a text tree representation of the qmenumodel to the indicators-client application.
Description of the change
Added a text tree representation of the qmenumodel to the indicators-client application.
Intended for debugging indicator issues.
The new functionality can be seen as a switch ('Enable Visual Representation') at the top of an indicator page in the indicators-client app.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michał Sawicz (saviq) wrote : | # |
plugins/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:97
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nick Dedekind (nick-dedekind) wrote : | # |
> plugins/
Removed.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nick Dedekind (nick-dedekind) wrote : | # |
Added back button to the indicators page.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:98
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Daniel d'Andrada (dandrader) wrote : | # |
Some unsolved merge conflicts
200 +<<<<<<< TREE
201 menucontentacti
202 +=======
203 + modelprinter.cpp
204 +>>>>>>> MERGE-SOURCE
369 +<<<<<<< TREE
370 #include "menucontentact
371 +=======
372 +#include "modelprinter.h"
373 +>>>>>>> MERGE-SOURCE
381 +<<<<<<< TREE
382 qmlRegisterType
383 +=======
384 + qmlRegisterType
385 +>>>>>>> MERGE-SOURCE
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:99
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nick Dedekind (nick-dedekind) wrote : | # |
> Some unsolved merge conflicts
>
> 200 +<<<<<<< TREE
> 201 menucontentacti
> 202 +=======
> 203 + modelprinter.cpp
> 204 +>>>>>>> MERGE-SOURCE
>
> 369 +<<<<<<< TREE
> 370 #include "menucontentact
> 371 +=======
> 372 +#include "modelprinter.h"
> 373 +>>>>>>> MERGE-SOURCE
>
> 381 +<<<<<<< TREE
> 382 qmlRegisterType
> "MenuContentAct
> 383 +=======
> 384 + qmlRegisterType
> 385 +>>>>>>> MERGE-SOURCE
Fixed.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Daniel d'Andrada (dandrader) wrote : | # |
Panel/Indicator
Please add your name to the "Authors" list in the header
- property alias pageSource : page_loader.source
+ property string pageSource : page_loader.source
Let's take the opportunity to s/page_
-----
Panel/Indicator
+ * Nick Dedekind <<email address hidden>
Missing the closing ">"
+ Text {
+ id: all_data
+ color: "white"
+ }
s/all_data/allData
+ Indicators.
+ id: printer
+ model: menuModel
+
+ onSourceChanged: page.refresh()
+ }
+ function refresh() {
+ all_data.text = printer.
+ }
Couldn't we make it more QMLish by making the string a property of ModelPrinter (and name it "text")?
So code would be simply:
Text {
id: allData
color: "white"
text: printer.text
}
----------------
plugins/
+ * Copyright (C) 2012 Canonical, Ltd.
s/2012/2013
+ QString recurse_
s/recurse_
+// Qt
+#include <QDebug>
s/QDebug/
+ stream << tabify(level) << roleNames[role] << "." << iter.key() << ": " << iter.value(
Too long
-------------------
plugins/
+ * Copyright (C) 2012 Canonical, Ltd.
s/2012/2013
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nick Dedekind (nick-dedekind) wrote : | # |
> Panel/Indicator
>
> Please add your name to the "Authors" list in the header
>
> - property alias pageSource : page_loader.source
> + property string pageSource : page_loader.source
>
> Let's take the opportunity to s/page_
>
> -----
>
> Panel/Indicator
>
> + * Nick Dedekind <<email address hidden>
>
> Missing the closing ">"
>
> + Text {
> + id: all_data
> + color: "white"
> + }
>
>
> s/all_data/allData
>
>
> + Indicators.
> + id: printer
> + model: menuModel
> +
> + onSourceChanged: page.refresh()
> + }
>
> + function refresh() {
> + all_data.text = printer.
> + }
>
>
> Couldn't we make it more QMLish by making the string a property of
> ModelPrinter (and name it "text")?
> So code would be simply:
>
> Text {
> id: allData
> color: "white"
> text: printer.text
> }
>
> ----------------
>
> plugins/
>
> + * Copyright (C) 2012 Canonical, Ltd.
>
> s/2012/2013
>
> + QString recurse_
>
> s/recurse_
>
> +// Qt
> +#include <QDebug>
>
> s/QDebug/
>
> + stream << tabify(level) << roleNames[role] << "." <<
> iter.key() << ": " << iter.value(
>
> Too long
>
> -------------------
>
> plugins/
>
> + * Copyright (C) 2012 Canonical, Ltd.
>
> s/2012/2013
Thanks. All done.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:100
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:101
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Daniel d'Andrada (dandrader) wrote : | # |
There's still this one:
Panel/Indicator
+ Text {
+ id: all_data
+ color: "white"
+ text: printer.txt
+ }
s/all_data/allData
But since I'll be away for a month, it's not worth holding it up.
Looks good to go.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'Panel/Indicators/client/IndicatorsClient.qml' | |||
2 | --- Panel/Indicators/client/IndicatorsClient.qml 2013-06-18 18:02:29 +0000 | |||
3 | +++ Panel/Indicators/client/IndicatorsClient.qml 2013-07-31 14:12:23 +0000 | |||
4 | @@ -27,16 +27,15 @@ | |||
5 | 27 | 27 | ||
6 | 28 | PageStack { | 28 | PageStack { |
7 | 29 | id: pages | 29 | id: pages |
8 | 30 | |||
9 | 31 | anchors.fill: parent | 30 | anchors.fill: parent |
12 | 32 | Component.onCompleted: root.reset() | 31 | Component.onCompleted: reset() |
11 | 33 | } | ||
13 | 34 | 32 | ||
20 | 35 | function reset() { | 33 | function reset() { |
21 | 36 | pages.clear(); | 34 | clear(); |
22 | 37 | var component = Qt.createComponent("IndicatorsList.qml"); | 35 | var component = Qt.createComponent("IndicatorsList.qml"); |
23 | 38 | var page = component.createObject(pages); | 36 | var page = component.createObject(pages); |
24 | 39 | console.log(component.errorString()); | 37 | console.log(component.errorString()); |
25 | 40 | pages.push(page); | 38 | push(page); |
26 | 39 | } | ||
27 | 41 | } | 40 | } |
28 | 42 | } | 41 | } |
29 | 43 | 42 | ||
30 | === modified file 'Panel/Indicators/client/IndicatorsPage.qml' | |||
31 | --- Panel/Indicators/client/IndicatorsPage.qml 2013-06-18 18:02:29 +0000 | |||
32 | +++ Panel/Indicators/client/IndicatorsPage.qml 2013-07-31 14:12:23 +0000 | |||
33 | @@ -15,35 +15,80 @@ | |||
34 | 15 | * | 15 | * |
35 | 16 | * Authors: | 16 | * Authors: |
36 | 17 | * Renato Araujo Oliveira Filho <renato@canonical.com> | 17 | * Renato Araujo Oliveira Filho <renato@canonical.com> |
37 | 18 | * Nick Dedekind <nick.dedekind@canonical.com> | ||
38 | 18 | */ | 19 | */ |
39 | 19 | 20 | ||
40 | 20 | import QtQuick 2.0 | 21 | import QtQuick 2.0 |
41 | 21 | import Ubuntu.Components 0.1 | 22 | import Ubuntu.Components 0.1 |
42 | 23 | import Ubuntu.Components.ListItems 0.1 as ListItem | ||
43 | 22 | 24 | ||
44 | 23 | Page { | 25 | Page { |
46 | 24 | id: _page | 26 | id: page |
47 | 25 | 27 | ||
48 | 26 | title: indicatorProperties && indicatorProperties.title ? indicatorProperties.title : "" | 28 | title: indicatorProperties && indicatorProperties.title ? indicatorProperties.title : "" |
49 | 27 | property variant indicatorProperties | 29 | property variant indicatorProperties |
51 | 28 | property alias pageSource : page_loader.source | 30 | property string pageSource : pageLoader.source |
52 | 29 | 31 | ||
53 | 30 | anchors.fill: parent | 32 | anchors.fill: parent |
54 | 31 | 33 | ||
55 | 34 | ListItem.Standard { | ||
56 | 35 | id: visualCheckItem | ||
57 | 36 | text: "Enable Visual Representation" | ||
58 | 37 | control: Switch { | ||
59 | 38 | id: visualCheck | ||
60 | 39 | checked: true | ||
61 | 40 | } | ||
62 | 41 | } | ||
63 | 42 | |||
64 | 32 | Loader { | 43 | Loader { |
76 | 33 | id: page_loader | 44 | id: pageLoader |
77 | 34 | objectName: "page_loader" | 45 | objectName: "pageLoader" |
78 | 35 | 46 | ||
79 | 36 | anchors.fill: parent | 47 | anchors { |
80 | 37 | 48 | top: visualCheckItem.bottom | |
81 | 38 | onStatusChanged: { | 49 | left: parent.left |
82 | 39 | if (status == Loader.Ready) { | 50 | right: parent.right |
83 | 40 | for(var pName in indicatorProperties) { | 51 | bottom: buttons.top |
84 | 41 | if (item.hasOwnProperty(pName)) { | 52 | topMargin: units.gu(2) |
85 | 42 | item[pName] = indicatorProperties[pName]; | 53 | bottomMargin: units.gu(2) |
86 | 43 | } | 54 | } |
87 | 55 | source : visualCheck.checked ? page.pageSource : "IndicatorsTree.qml" | ||
88 | 56 | |||
89 | 57 | onLoaded: { | ||
90 | 58 | for(var pName in indicatorProperties) { | ||
91 | 59 | if (item.hasOwnProperty(pName)) { | ||
92 | 60 | item[pName] = indicatorProperties[pName]; | ||
93 | 44 | } | 61 | } |
96 | 45 | item.start(); | 62 | } |
97 | 46 | } | 63 | item.start(); |
98 | 64 | } | ||
99 | 65 | } | ||
100 | 66 | |||
101 | 67 | Item { | ||
102 | 68 | id: buttons | ||
103 | 69 | anchors { | ||
104 | 70 | left: parent.left | ||
105 | 71 | right: parent.right | ||
106 | 72 | bottom: parent.bottom | ||
107 | 73 | margins: units.gu(1) | ||
108 | 74 | } | ||
109 | 75 | height: childrenRect.height | ||
110 | 76 | |||
111 | 77 | Button { | ||
112 | 78 | anchors { | ||
113 | 79 | left: parent.left | ||
114 | 80 | } | ||
115 | 81 | text: "Back" | ||
116 | 82 | onClicked: page.pageStack.reset() | ||
117 | 83 | } | ||
118 | 84 | Button { | ||
119 | 85 | id: refresh | ||
120 | 86 | visible: !visualCheck.checked | ||
121 | 87 | anchors { | ||
122 | 88 | right: parent.right | ||
123 | 89 | } | ||
124 | 90 | text: "Refresh" | ||
125 | 91 | onClicked: pageLoader.item.refresh() | ||
126 | 47 | } | 92 | } |
127 | 48 | } | 93 | } |
128 | 49 | } | 94 | } |
129 | 50 | 95 | ||
130 | === added file 'Panel/Indicators/client/IndicatorsTree.qml' | |||
131 | --- Panel/Indicators/client/IndicatorsTree.qml 1970-01-01 00:00:00 +0000 | |||
132 | +++ Panel/Indicators/client/IndicatorsTree.qml 2013-07-31 14:12:23 +0000 | |||
133 | @@ -0,0 +1,62 @@ | |||
134 | 1 | /* | ||
135 | 2 | * Copyright 2013 Canonical Ltd. | ||
136 | 3 | * | ||
137 | 4 | * This program is free software; you can redistribute it and/or modify | ||
138 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
139 | 6 | * the Free Software Foundation; version 3. | ||
140 | 7 | * | ||
141 | 8 | * This program is distributed in the hope that it will be useful, | ||
142 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
143 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
144 | 11 | * GNU Lesser General Public License for more details. | ||
145 | 12 | * | ||
146 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
147 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
148 | 15 | * | ||
149 | 16 | * Authors: | ||
150 | 17 | * Nick Dedekind <nick.dededkind@canonical.com> | ||
151 | 18 | */ | ||
152 | 19 | |||
153 | 20 | import QtQuick 2.0 | ||
154 | 21 | import Ubuntu.Components 0.1 | ||
155 | 22 | import Unity.Indicators 0.1 as Indicators | ||
156 | 23 | import QMenuModel 0.1 | ||
157 | 24 | import Ubuntu.Components.ListItems 0.1 as ListItem | ||
158 | 25 | |||
159 | 26 | Page { | ||
160 | 27 | id: page | ||
161 | 28 | anchors.fill: parent | ||
162 | 29 | |||
163 | 30 | property alias busType: menuModel.busType | ||
164 | 31 | property alias busName: menuModel.busName | ||
165 | 32 | property string actionsObjectPath | ||
166 | 33 | property var menuObjectPaths: undefined | ||
167 | 34 | readonly property string device: "phone" | ||
168 | 35 | |||
169 | 36 | property string deviceMenuObjectPath: menuObjectPaths.hasOwnProperty(device) ? menuObjectPaths[device] : "" | ||
170 | 37 | |||
171 | 38 | function start() { | ||
172 | 39 | menuModel.start(); | ||
173 | 40 | } | ||
174 | 41 | |||
175 | 42 | QDBusMenuModel { | ||
176 | 43 | id: menuModel | ||
177 | 44 | objectPath: page.deviceMenuObjectPath | ||
178 | 45 | } | ||
179 | 46 | |||
180 | 47 | Indicators.ModelPrinter { | ||
181 | 48 | id: printer | ||
182 | 49 | model: menuModel | ||
183 | 50 | } | ||
184 | 51 | |||
185 | 52 | Flickable { | ||
186 | 53 | anchors.fill: parent | ||
187 | 54 | contentHeight: all_data.height | ||
188 | 55 | clip:true | ||
189 | 56 | Text { | ||
190 | 57 | id: all_data | ||
191 | 58 | color: "white" | ||
192 | 59 | text: printer.text | ||
193 | 60 | } | ||
194 | 61 | } | ||
195 | 62 | } | ||
196 | 0 | 63 | ||
197 | === modified file 'plugins/Unity/Indicators/CMakeLists.txt' | |||
198 | --- plugins/Unity/Indicators/CMakeLists.txt 2013-07-17 09:11:03 +0000 | |||
199 | +++ plugins/Unity/Indicators/CMakeLists.txt 2013-07-31 14:12:23 +0000 | |||
200 | @@ -24,6 +24,7 @@ | |||
201 | 24 | indicatorsmanager.cpp | 24 | indicatorsmanager.cpp |
202 | 25 | indicatorsmodel.cpp | 25 | indicatorsmodel.cpp |
203 | 26 | menucontentactivator.cpp | 26 | menucontentactivator.cpp |
204 | 27 | modelprinter.cpp | ||
205 | 27 | plugin.cpp | 28 | plugin.cpp |
206 | 28 | ) | 29 | ) |
207 | 29 | add_definitions(-DUNITYINDICATORS_LIBRARY) | 30 | add_definitions(-DUNITYINDICATORS_LIBRARY) |
208 | 30 | 31 | ||
209 | === added file 'plugins/Unity/Indicators/modelprinter.cpp' | |||
210 | --- plugins/Unity/Indicators/modelprinter.cpp 1970-01-01 00:00:00 +0000 | |||
211 | +++ plugins/Unity/Indicators/modelprinter.cpp 2013-07-31 14:12:23 +0000 | |||
212 | @@ -0,0 +1,114 @@ | |||
213 | 1 | /* | ||
214 | 2 | * Copyright 2013 Canonical Ltd. | ||
215 | 3 | * | ||
216 | 4 | * This program is free software; you can redistribute it and/or modify | ||
217 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
218 | 6 | * the Free Software Foundation; version 3. | ||
219 | 7 | * | ||
220 | 8 | * This program is distributed in the hope that it will be useful, | ||
221 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
222 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
223 | 11 | * GNU Lesser General Public License for more details. | ||
224 | 12 | * | ||
225 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
226 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
227 | 15 | * | ||
228 | 16 | * Authors: | ||
229 | 17 | * Nick Dedekind <nick.dedekind@canonical.com> | ||
230 | 18 | */ | ||
231 | 19 | |||
232 | 20 | // self | ||
233 | 21 | #include "modelprinter.h" | ||
234 | 22 | |||
235 | 23 | // Qt | ||
236 | 24 | #include <QTextStream> | ||
237 | 25 | |||
238 | 26 | ModelPrinter::ModelPrinter(QObject *parent) | ||
239 | 27 | : QObject(parent) | ||
240 | 28 | , m_model(NULL) | ||
241 | 29 | { | ||
242 | 30 | } | ||
243 | 31 | |||
244 | 32 | void ModelPrinter::setSourceModel(QAbstractItemModel * sourceModel) | ||
245 | 33 | { | ||
246 | 34 | if (m_model != NULL) { | ||
247 | 35 | disconnect(m_model); | ||
248 | 36 | } | ||
249 | 37 | if (m_model != sourceModel) { | ||
250 | 38 | m_model = sourceModel; | ||
251 | 39 | Q_EMIT modelChanged(); | ||
252 | 40 | Q_EMIT textChanged(); | ||
253 | 41 | } | ||
254 | 42 | if (m_model != NULL) { | ||
255 | 43 | connect(m_model, SIGNAL(modelReset()), this, SIGNAL(textChanged())); | ||
256 | 44 | connect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SIGNAL(textChanged())); | ||
257 | 45 | connect(m_model, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SIGNAL(textChanged())); | ||
258 | 46 | } | ||
259 | 47 | } | ||
260 | 48 | |||
261 | 49 | QAbstractItemModel* ModelPrinter::sourceModel() const | ||
262 | 50 | { | ||
263 | 51 | return m_model; | ||
264 | 52 | } | ||
265 | 53 | |||
266 | 54 | QString ModelPrinter::text(const QModelIndex& index) const | ||
267 | 55 | { | ||
268 | 56 | return recurseString(index, 0); | ||
269 | 57 | } | ||
270 | 58 | |||
271 | 59 | QString tabify(int level) { QString str; | ||
272 | 60 | for (int i = 0; i < level; i++) { | ||
273 | 61 | str += " "; | ||
274 | 62 | } | ||
275 | 63 | return str; | ||
276 | 64 | } | ||
277 | 65 | |||
278 | 66 | QString ModelPrinter::recurseString(const QModelIndex& index, int level) const | ||
279 | 67 | { | ||
280 | 68 | if (!m_model) | ||
281 | 69 | return ""; | ||
282 | 70 | |||
283 | 71 | QString str; | ||
284 | 72 | QTextStream stream(&str); | ||
285 | 73 | |||
286 | 74 | QHash<int, QByteArray> roleNames = m_model->roleNames(); | ||
287 | 75 | QList<int> roles = roleNames.keys(); | ||
288 | 76 | qSort(roles); | ||
289 | 77 | Q_FOREACH(int role, roles) { | ||
290 | 78 | QVariant vData = m_model->data(index, role); | ||
291 | 79 | if (vData.canConvert(QMetaType::QVariantMap)) { | ||
292 | 80 | QMapIterator<QString, QVariant> iter(vData.toMap()); | ||
293 | 81 | while (iter.hasNext()) { | ||
294 | 82 | iter.next(); | ||
295 | 83 | stream << tabify(level) | ||
296 | 84 | << roleNames[role] | ||
297 | 85 | << "." | ||
298 | 86 | << iter.key() | ||
299 | 87 | << ": " | ||
300 | 88 | << iter.value().toString() | ||
301 | 89 | << endl; | ||
302 | 90 | } | ||
303 | 91 | } | ||
304 | 92 | else { | ||
305 | 93 | stream << tabify(level) | ||
306 | 94 | << roleNames[role] | ||
307 | 95 | << ": " | ||
308 | 96 | << vData.toString() | ||
309 | 97 | << endl; | ||
310 | 98 | } | ||
311 | 99 | } | ||
312 | 100 | |||
313 | 101 | int rowCount = m_model->rowCount(index); | ||
314 | 102 | stream << tabify(level) | ||
315 | 103 | << "child count" | ||
316 | 104 | << ": " | ||
317 | 105 | << rowCount | ||
318 | 106 | << endl | ||
319 | 107 | << endl; | ||
320 | 108 | |||
321 | 109 | for (int i = 0; i < rowCount; i++) { | ||
322 | 110 | QModelIndex child = m_model->index(i, 0, index); | ||
323 | 111 | str += recurseString(child, level+1); | ||
324 | 112 | } | ||
325 | 113 | return str; | ||
326 | 114 | } | ||
327 | 0 | 115 | ||
328 | === added file 'plugins/Unity/Indicators/modelprinter.h' | |||
329 | --- plugins/Unity/Indicators/modelprinter.h 1970-01-01 00:00:00 +0000 | |||
330 | +++ plugins/Unity/Indicators/modelprinter.h 2013-07-31 14:12:23 +0000 | |||
331 | @@ -0,0 +1,50 @@ | |||
332 | 1 | /* | ||
333 | 2 | * Copyright 2013 Canonical Ltd. | ||
334 | 3 | * | ||
335 | 4 | * This program is free software; you can redistribute it and/or modify | ||
336 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
337 | 6 | * the Free Software Foundation; version 3. | ||
338 | 7 | * | ||
339 | 8 | * This program is distributed in the hope that it will be useful, | ||
340 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
341 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
342 | 11 | * GNU Lesser General Public License for more details. | ||
343 | 12 | * | ||
344 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
345 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
346 | 15 | * | ||
347 | 16 | * Authors: | ||
348 | 17 | * Nick Dedekind <nick.dedekind@canonical.com> | ||
349 | 18 | */ | ||
350 | 19 | |||
351 | 20 | #ifndef MODELPRINTER_H | ||
352 | 21 | #define MODELPRINTER_H | ||
353 | 22 | |||
354 | 23 | #include <QSortFilterProxyModel> | ||
355 | 24 | |||
356 | 25 | // This class acts as a namespace only, with the addition that its enums | ||
357 | 26 | // are registered to be exposed on the QML side. | ||
358 | 27 | class ModelPrinter : public QObject | ||
359 | 28 | { | ||
360 | 29 | Q_OBJECT | ||
361 | 30 | |||
362 | 31 | Q_PROPERTY(QAbstractItemModel* model READ sourceModel WRITE setSourceModel NOTIFY modelChanged) | ||
363 | 32 | Q_PROPERTY(QString text READ text NOTIFY textChanged) | ||
364 | 33 | public: | ||
365 | 34 | ModelPrinter(QObject* parent=0); | ||
366 | 35 | |||
367 | 36 | void setSourceModel(QAbstractItemModel* sourceModel); | ||
368 | 37 | QAbstractItemModel* sourceModel() const; | ||
369 | 38 | |||
370 | 39 | Q_INVOKABLE QString text(const QModelIndex& index = QModelIndex()) const; | ||
371 | 40 | |||
372 | 41 | Q_SIGNALS: | ||
373 | 42 | void modelChanged(); | ||
374 | 43 | void textChanged(); | ||
375 | 44 | |||
376 | 45 | private: | ||
377 | 46 | QString recurseString(const QModelIndex& index, int level) const; | ||
378 | 47 | QAbstractItemModel* m_model; | ||
379 | 48 | }; | ||
380 | 49 | |||
381 | 50 | #endif // MODELPRINTER_H | ||
382 | 0 | 51 | ||
383 | === modified file 'plugins/Unity/Indicators/plugin.cpp' | |||
384 | --- plugins/Unity/Indicators/plugin.cpp 2013-07-17 09:11:03 +0000 | |||
385 | +++ plugins/Unity/Indicators/plugin.cpp 2013-07-31 14:12:23 +0000 | |||
386 | @@ -28,6 +28,7 @@ | |||
387 | 28 | #include "indicatorsmodel.h" | 28 | #include "indicatorsmodel.h" |
388 | 29 | #include "indicators.h" | 29 | #include "indicators.h" |
389 | 30 | #include "menucontentactivator.h" | 30 | #include "menucontentactivator.h" |
390 | 31 | #include "modelprinter.h" | ||
391 | 31 | 32 | ||
392 | 32 | void IndicatorsPlugin::registerTypes(const char *uri) | 33 | void IndicatorsPlugin::registerTypes(const char *uri) |
393 | 33 | { | 34 | { |
394 | @@ -36,6 +37,7 @@ | |||
395 | 36 | qmlRegisterType<IndicatorsManager>(uri, 0, 1, "IndicatorsManager"); | 37 | qmlRegisterType<IndicatorsManager>(uri, 0, 1, "IndicatorsManager"); |
396 | 37 | qmlRegisterType<FlatMenuProxyModel>(uri, 0, 1, "FlatMenuProxyModel"); | 38 | qmlRegisterType<FlatMenuProxyModel>(uri, 0, 1, "FlatMenuProxyModel"); |
397 | 38 | qmlRegisterType<IndicatorsModel>(uri, 0, 1, "IndicatorsModel"); | 39 | qmlRegisterType<IndicatorsModel>(uri, 0, 1, "IndicatorsModel"); |
398 | 40 | qmlRegisterType<ModelPrinter>(uri, 0, 1, "ModelPrinter"); | ||
399 | 39 | qmlRegisterType<MenuContentActivator>(uri, 0, 1, "MenuContentActivator"); | 41 | qmlRegisterType<MenuContentActivator>(uri, 0, 1, "MenuContentActivator"); |
400 | 40 | 42 | ||
401 | 41 | qmlRegisterUncreatableType<MenuContentState>(uri, 0, 1, "MenuContentState", "Can't create MenuContentState class"); | 43 | qmlRegisterUncreatableType<MenuContentState>(uri, 0, 1, "MenuContentState", "Can't create MenuContentState class"); |
402 | 42 | 44 | ||
403 | === modified file 'tests/autopilot/unity8/indicators_client/tests/test_battery.py' | |||
404 | --- tests/autopilot/unity8/indicators_client/tests/test_battery.py 2013-07-24 13:56:28 +0000 | |||
405 | +++ tests/autopilot/unity8/indicators_client/tests/test_battery.py 2013-07-31 14:12:23 +0000 | |||
406 | @@ -26,7 +26,7 @@ | |||
407 | 26 | self.pointing_device.move_to_object(self.main_window.get_battery_menu()) | 26 | self.pointing_device.move_to_object(self.main_window.get_battery_menu()) |
408 | 27 | self.pointing_device.click() | 27 | self.pointing_device.click() |
409 | 28 | 28 | ||
411 | 29 | fn_loader = lambda: self.app.select_single("IndicatorsPage/QQuickLoader", objectName="page_loader"); | 29 | fn_loader = lambda: self.app.select_single("IndicatorsPage/QQuickLoader", objectName="pageLoader"); |
412 | 30 | self.assertThat(fn_loader, Eventually(NotEquals(None))); | 30 | self.assertThat(fn_loader, Eventually(NotEquals(None))); |
413 | 31 | page_loader = fn_loader(); | 31 | page_loader = fn_loader(); |
414 | 32 | self.assertThat(page_loader.progress, Eventually(Equals(1.0))) | 32 | self.assertThat(page_loader.progress, Eventually(Equals(1.0))) |
FAILED: Continuous integration, rev:96 jenkins. qa.ubuntu. com/job/ unity8- ci/283/ jenkins. qa.ubuntu. com/job/ generic- mediumtests- saucy/1177/ console jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- saucy/635/ console jenkins. qa.ubuntu. com/job/ unity8- saucy-armhf- ci/283/ console jenkins. qa.ubuntu. com/job/ unity8- saucy-i386- ci/283/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy/1181/ console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins: 8080/job/ unity8- ci/283/ rebuild
http://