Merge lp:~saviq/unity8/revert-background into lp:unity8
- revert-background
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Gerry Boland |
Approved revision: | 166 |
Merged at revision: | 168 |
Proposed branch: | lp:~saviq/unity8/revert-background |
Merge into: | lp:unity8 |
Diff against target: |
514 lines (+12/-327) 13 files modified
Components/CrossFadeImage.qml (+1/-3) Greeter/GreeterContent.qml (+1/-0) Shell.qml (+8/-16) debian/control (+1/-3) tests/mocks/CMakeLists.txt (+0/-1) tests/mocks/GSettings/CMakeLists.txt (+0/-31) tests/mocks/GSettings/fake_gsettings.cpp (+0/-102) tests/mocks/GSettings/fake_gsettings.h (+0/-90) tests/mocks/GSettings/plugin.cpp (+0/-33) tests/mocks/GSettings/plugin.h (+0/-31) tests/mocks/GSettings/qmldir (+0/-2) tests/qmltests/CMakeLists.txt (+1/-1) tests/qmltests/tst_Shell.qml (+0/-14) |
To merge this branch: | bzr merge lp:~saviq/unity8/revert-background |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Gerry Boland (community) | Approve | ||
Albert Astals Cid (community) | functional | Approve | |
Review via email:
|
Commit message
Revert revision 161 that causes issues with invalid background.
Description of the change
The background fallback isn't working and causes autopilot failures. See bug #1208868 for some details.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Gerry Boland (gerboland) : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:166
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://
Preview Diff
1 | === modified file 'Components/CrossFadeImage.qml' | |||
2 | --- Components/CrossFadeImage.qml 2013-07-24 15:27:11 +0000 | |||
3 | +++ Components/CrossFadeImage.qml 2013-08-06 15:23:36 +0000 | |||
4 | @@ -85,7 +85,7 @@ | |||
5 | 85 | Connections { | 85 | Connections { |
6 | 86 | target: __nextImage | 86 | target: __nextImage |
7 | 87 | onStatusChanged: { | 87 | onStatusChanged: { |
9 | 88 | if (__nextImage.status == Image.Ready || __nextImage.status == Image.Error) { | 88 | if (__nextImage.status == Image.Ready) { |
10 | 89 | swapImages(); | 89 | swapImages(); |
11 | 90 | } | 90 | } |
12 | 91 | } | 91 | } |
13 | @@ -96,7 +96,6 @@ | |||
14 | 96 | anchors.fill: parent | 96 | anchors.fill: parent |
15 | 97 | cache: false | 97 | cache: false |
16 | 98 | asynchronous: true | 98 | asynchronous: true |
17 | 99 | fillMode: Image.PreserveAspectCrop | ||
18 | 100 | z: 1 | 99 | z: 1 |
19 | 101 | } | 100 | } |
20 | 102 | 101 | ||
21 | @@ -105,7 +104,6 @@ | |||
22 | 105 | anchors.fill: parent | 104 | anchors.fill: parent |
23 | 106 | cache: false | 105 | cache: false |
24 | 107 | asynchronous: true | 106 | asynchronous: true |
25 | 108 | fillMode: Image.PreserveAspectCrop | ||
26 | 109 | z: 0 | 107 | z: 0 |
27 | 110 | } | 108 | } |
28 | 111 | 109 | ||
29 | 112 | 110 | ||
30 | === modified file 'Greeter/GreeterContent.qml' | |||
31 | --- Greeter/GreeterContent.qml 2013-08-02 16:16:31 +0000 | |||
32 | +++ Greeter/GreeterContent.qml 2013-08-06 15:23:36 +0000 | |||
33 | @@ -37,6 +37,7 @@ | |||
34 | 37 | 37 | ||
35 | 38 | source: shell.background | 38 | source: shell.background |
36 | 39 | anchors.fill: parent | 39 | anchors.fill: parent |
37 | 40 | crossFade: false | ||
38 | 40 | fadeInFirst: false | 41 | fadeInFirst: false |
39 | 41 | } | 42 | } |
40 | 42 | 43 | ||
41 | 43 | 44 | ||
42 | === modified file 'Shell.qml' | |||
43 | --- Shell.qml 2013-08-02 19:10:00 +0000 | |||
44 | +++ Shell.qml 2013-08-06 15:23:36 +0000 | |||
45 | @@ -15,7 +15,6 @@ | |||
46 | 15 | */ | 15 | */ |
47 | 16 | 16 | ||
48 | 17 | import QtQuick 2.0 | 17 | import QtQuick 2.0 |
49 | 18 | import GSettings 1.0 | ||
50 | 19 | import Ubuntu.Application 0.1 | 18 | import Ubuntu.Application 0.1 |
51 | 20 | import Ubuntu.Components 0.1 | 19 | import Ubuntu.Components 0.1 |
52 | 21 | import Ubuntu.Gestures 0.1 | 20 | import Ubuntu.Gestures 0.1 |
53 | @@ -42,8 +41,8 @@ | |||
54 | 42 | height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71) | 41 | height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71) |
55 | 43 | 42 | ||
56 | 44 | property real edgeSize: units.gu(2) | 43 | property real edgeSize: units.gu(2) |
59 | 45 | property url defaultBackground: shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg" | 44 | property url default_background: shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg" |
60 | 46 | property url background: backgroundSettings.pictureUri | 45 | property url background: default_background |
61 | 47 | readonly property real panelHeight: panel.panelHeight | 46 | readonly property real panelHeight: panel.panelHeight |
62 | 48 | 47 | ||
63 | 49 | property bool dashShown: dash.shown | 48 | property bool dashShown: dash.shown |
64 | @@ -116,11 +115,6 @@ | |||
65 | 116 | } | 115 | } |
66 | 117 | } | 116 | } |
67 | 118 | 117 | ||
68 | 119 | GSettings { | ||
69 | 120 | id: backgroundSettings | ||
70 | 121 | schema.id: "org.gnome.desktop.background" | ||
71 | 122 | } | ||
72 | 123 | |||
73 | 124 | VolumeControl { | 118 | VolumeControl { |
74 | 125 | id: volumeControl | 119 | id: volumeControl |
75 | 126 | } | 120 | } |
76 | @@ -145,16 +139,12 @@ | |||
77 | 145 | // through the translucent parts of the shell surface. | 139 | // through the translucent parts of the shell surface. |
78 | 146 | visible: !fullyCovered && !applicationSurfaceShouldBeSeen | 140 | visible: !fullyCovered && !applicationSurfaceShouldBeSeen |
79 | 147 | 141 | ||
81 | 148 | CrossFadeImage { | 142 | Image { |
82 | 149 | id: backgroundImage | 143 | id: backgroundImage |
83 | 150 | objectName: "backgroundImage" | ||
84 | 151 | source: shell.background | 144 | source: shell.background |
85 | 145 | sourceSize.width: parent.width | ||
86 | 146 | sourceSize.height: parent.height | ||
87 | 152 | anchors.fill: parent | 147 | anchors.fill: parent |
88 | 153 | onStatusChanged: { | ||
89 | 154 | if (status == Image.Error) { | ||
90 | 155 | backgroundSettings.pictureUri = shell.defaultBackground | ||
91 | 156 | } | ||
92 | 157 | } | ||
93 | 158 | } | 148 | } |
94 | 159 | 149 | ||
95 | 160 | Rectangle { | 150 | Rectangle { |
96 | @@ -199,6 +189,7 @@ | |||
97 | 199 | } | 189 | } |
98 | 200 | } | 190 | } |
99 | 201 | 191 | ||
100 | 192 | |||
101 | 202 | Item { | 193 | Item { |
102 | 203 | id: stagesOuterContainer | 194 | id: stagesOuterContainer |
103 | 204 | 195 | ||
104 | @@ -263,6 +254,7 @@ | |||
105 | 263 | ignoreUnknownSignals: true | 254 | ignoreUnknownSignals: true |
106 | 264 | } | 255 | } |
107 | 265 | 256 | ||
108 | 257 | |||
109 | 266 | Stage { | 258 | Stage { |
110 | 267 | id: mainStage | 259 | id: mainStage |
111 | 268 | 260 | ||
112 | @@ -438,7 +430,7 @@ | |||
113 | 438 | onUnlocked: greeter.hide() | 430 | onUnlocked: greeter.hide() |
114 | 439 | onSelected: { | 431 | onSelected: { |
115 | 440 | var bgPath = greeter.model.data(uid, LightDM.UserRoles.BackgroundPathRole) | 432 | var bgPath = greeter.model.data(uid, LightDM.UserRoles.BackgroundPathRole) |
117 | 441 | shell.background = bgPath ? bgPath : defaultBackground | 433 | shell.background = bgPath ? bgPath : default_background |
118 | 442 | } | 434 | } |
119 | 443 | 435 | ||
120 | 444 | onLeftTeaserPressedChanged: { | 436 | onLeftTeaserPressedChanged: { |
121 | 445 | 437 | ||
122 | === modified file 'debian/control' | |||
123 | --- debian/control 2013-08-02 16:16:31 +0000 | |||
124 | +++ debian/control 2013-08-06 15:23:36 +0000 | |||
125 | @@ -56,10 +56,8 @@ | |||
126 | 56 | 56 | ||
127 | 57 | Package: unity8 | 57 | Package: unity8 |
128 | 58 | Architecture: any | 58 | Architecture: any |
131 | 59 | Depends: gsettings-desktop-schemas, | 59 | Depends: qmenumodel-qml, |
130 | 60 | qmenumodel-qml, | ||
132 | 61 | qtdeclarative5-dee-plugin, | 60 | qtdeclarative5-dee-plugin, |
133 | 62 | qtdeclarative5-gsettings1.0, | ||
134 | 63 | qtdeclarative5-ubuntu-ui-toolkit-plugin, | 61 | qtdeclarative5-ubuntu-ui-toolkit-plugin, |
135 | 64 | qtdeclarative5-unity-notifications-plugin | unity-notifications-impl, | 62 | qtdeclarative5-unity-notifications-plugin | unity-notifications-impl, |
136 | 65 | qtdeclarative5-xmllistmodel-plugin, | 63 | qtdeclarative5-xmllistmodel-plugin, |
137 | 66 | 64 | ||
138 | === removed directory 'tests/data/unity/backgrounds' | |||
139 | === removed file 'tests/data/unity/backgrounds/blue.png' | |||
140 | 67 | Binary files tests/data/unity/backgrounds/blue.png 2013-07-26 10:48:37 +0000 and tests/data/unity/backgrounds/blue.png 1970-01-01 00:00:00 +0000 differ | 65 | Binary files tests/data/unity/backgrounds/blue.png 2013-07-26 10:48:37 +0000 and tests/data/unity/backgrounds/blue.png 1970-01-01 00:00:00 +0000 differ |
141 | === removed file 'tests/data/unity/backgrounds/red.png' | |||
142 | 68 | Binary files tests/data/unity/backgrounds/red.png 2013-07-26 10:48:37 +0000 and tests/data/unity/backgrounds/red.png 1970-01-01 00:00:00 +0000 differ | 66 | Binary files tests/data/unity/backgrounds/red.png 2013-07-26 10:48:37 +0000 and tests/data/unity/backgrounds/red.png 1970-01-01 00:00:00 +0000 differ |
143 | === modified file 'tests/mocks/CMakeLists.txt' | |||
144 | --- tests/mocks/CMakeLists.txt 2013-07-26 11:10:55 +0000 | |||
145 | +++ tests/mocks/CMakeLists.txt 2013-08-06 15:23:36 +0000 | |||
146 | @@ -1,4 +1,3 @@ | |||
147 | 1 | add_subdirectory(GSettings) | ||
148 | 2 | add_subdirectory(libusermetrics) | 1 | add_subdirectory(libusermetrics) |
149 | 3 | add_subdirectory(LightDM) | 2 | add_subdirectory(LightDM) |
150 | 4 | add_subdirectory(QMenuModel) | 3 | add_subdirectory(QMenuModel) |
151 | 5 | 4 | ||
152 | === removed directory 'tests/mocks/GSettings' | |||
153 | === removed file 'tests/mocks/GSettings/CMakeLists.txt' | |||
154 | --- tests/mocks/GSettings/CMakeLists.txt 2013-07-25 16:41:29 +0000 | |||
155 | +++ tests/mocks/GSettings/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
156 | @@ -1,31 +0,0 @@ | |||
157 | 1 | set(CMAKE_AUTOMOC ON) | ||
158 | 2 | |||
159 | 3 | include(FindPkgConfig) | ||
160 | 4 | find_package(Qt5Core REQUIRED) | ||
161 | 5 | find_package(Qt5Quick REQUIRED) | ||
162 | 6 | |||
163 | 7 | include_directories( | ||
164 | 8 | ${CMAKE_CURRENT_BINARY_DIR} | ||
165 | 9 | ${Qt5Core_INCLUDE_DIRS} | ||
166 | 10 | ${Qt5Quick_INCLUDE_DIRS} | ||
167 | 11 | ) | ||
168 | 12 | |||
169 | 13 | add_definitions(-DQT_NO_KEYWORDS) | ||
170 | 14 | |||
171 | 15 | set(GSettingsQML_SOURCES | ||
172 | 16 | fake_gsettings.cpp | ||
173 | 17 | plugin.cpp | ||
174 | 18 | ) | ||
175 | 19 | |||
176 | 20 | add_library(FakeGSettingsQml MODULE ${GSettingsQML_SOURCES}) | ||
177 | 21 | target_link_libraries(FakeGSettingsQml | ||
178 | 22 | ${Qt5Core_LIBRARIES} | ||
179 | 23 | ${Qt5Quick_LIBRARIES} | ||
180 | 24 | ) | ||
181 | 25 | |||
182 | 26 | qt5_use_modules(FakeGSettingsQml Qml) | ||
183 | 27 | |||
184 | 28 | # copy qmldir file into build directory for shadow builds | ||
185 | 29 | file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir" | ||
186 | 30 | DESTINATION ${CMAKE_CURRENT_BINARY_DIR} | ||
187 | 31 | ) | ||
188 | 32 | 0 | ||
189 | === removed file 'tests/mocks/GSettings/fake_gsettings.cpp' | |||
190 | --- tests/mocks/GSettings/fake_gsettings.cpp 2013-07-26 13:27:28 +0000 | |||
191 | +++ tests/mocks/GSettings/fake_gsettings.cpp 1970-01-01 00:00:00 +0000 | |||
192 | @@ -1,102 +0,0 @@ | |||
193 | 1 | /* | ||
194 | 2 | * Copyright 2013 Canonical Ltd. | ||
195 | 3 | * | ||
196 | 4 | * This program is free software; you can redistribute it and/or modify | ||
197 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
198 | 6 | * the Free Software Foundation; version 3. | ||
199 | 7 | * | ||
200 | 8 | * This program is distributed in the hope that it will be useful, | ||
201 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
202 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
203 | 11 | * GNU Lesser General Public License for more details. | ||
204 | 12 | * | ||
205 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
206 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
207 | 15 | */ | ||
208 | 16 | |||
209 | 17 | #include "fake_gsettings.h" | ||
210 | 18 | |||
211 | 19 | #include <QList> | ||
212 | 20 | |||
213 | 21 | GSettingsControllerQml* GSettingsControllerQml::s_controllerInstance = 0; | ||
214 | 22 | |||
215 | 23 | GSettingsControllerQml::GSettingsControllerQml() { | ||
216 | 24 | } | ||
217 | 25 | |||
218 | 26 | GSettingsControllerQml::~GSettingsControllerQml() { | ||
219 | 27 | s_controllerInstance = 0; | ||
220 | 28 | } | ||
221 | 29 | |||
222 | 30 | GSettingsControllerQml* GSettingsControllerQml::instance() { | ||
223 | 31 | if(!s_controllerInstance) { | ||
224 | 32 | s_controllerInstance = new GSettingsControllerQml(); | ||
225 | 33 | } | ||
226 | 34 | return s_controllerInstance; | ||
227 | 35 | } | ||
228 | 36 | |||
229 | 37 | void GSettingsControllerQml::registerSettingsObject(GSettingsQml *obj) { | ||
230 | 38 | m_registeredGSettings.append(obj); | ||
231 | 39 | } | ||
232 | 40 | |||
233 | 41 | void GSettingsControllerQml::unRegisterSettingsObject(GSettingsQml *obj) { | ||
234 | 42 | m_registeredGSettings.removeOne(obj); | ||
235 | 43 | } | ||
236 | 44 | |||
237 | 45 | void GSettingsControllerQml::setPictureUri(const QString &str) { | ||
238 | 46 | Q_FOREACH (GSettingsQml *obj, m_registeredGSettings) { | ||
239 | 47 | obj->setPictureUri(str); | ||
240 | 48 | } | ||
241 | 49 | } | ||
242 | 50 | |||
243 | 51 | GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) { | ||
244 | 52 | } | ||
245 | 53 | |||
246 | 54 | QByteArray GSettingsSchemaQml::id() const { | ||
247 | 55 | return m_id; | ||
248 | 56 | } | ||
249 | 57 | |||
250 | 58 | void GSettingsSchemaQml::setId(const QByteArray &id) { | ||
251 | 59 | if (m_id.isEmpty()) { | ||
252 | 60 | qWarning("GSettings.schema.id may only be set on construction"); | ||
253 | 61 | return; | ||
254 | 62 | } | ||
255 | 63 | |||
256 | 64 | m_id = id; | ||
257 | 65 | } | ||
258 | 66 | |||
259 | 67 | QByteArray GSettingsSchemaQml::path() const { | ||
260 | 68 | return m_path; | ||
261 | 69 | } | ||
262 | 70 | |||
263 | 71 | void GSettingsSchemaQml::setPath(const QByteArray &path) { | ||
264 | 72 | if (m_path.isEmpty()) { | ||
265 | 73 | qWarning("GSettings.schema.path may only be set on construction"); | ||
266 | 74 | return; | ||
267 | 75 | } | ||
268 | 76 | |||
269 | 77 | m_path = path; | ||
270 | 78 | } | ||
271 | 79 | |||
272 | 80 | GSettingsQml::GSettingsQml(QObject *parent): QObject(parent) { | ||
273 | 81 | m_schema = new GSettingsSchemaQml(this); | ||
274 | 82 | GSettingsControllerQml::instance()->registerSettingsObject(this); | ||
275 | 83 | } | ||
276 | 84 | |||
277 | 85 | GSettingsQml::~GSettingsQml() { | ||
278 | 86 | GSettingsControllerQml::instance()->unRegisterSettingsObject(this); | ||
279 | 87 | } | ||
280 | 88 | |||
281 | 89 | GSettingsSchemaQml * GSettingsQml::schema() const { | ||
282 | 90 | return m_schema; | ||
283 | 91 | } | ||
284 | 92 | |||
285 | 93 | QString GSettingsQml::pictureUri() const { | ||
286 | 94 | return m_pictureUri; | ||
287 | 95 | } | ||
288 | 96 | |||
289 | 97 | void GSettingsQml::setPictureUri(const QString &str) { | ||
290 | 98 | if (str != m_pictureUri) { | ||
291 | 99 | m_pictureUri = str; | ||
292 | 100 | Q_EMIT pictureUriChanged(m_pictureUri); | ||
293 | 101 | } | ||
294 | 102 | } | ||
295 | 103 | 0 | ||
296 | === removed file 'tests/mocks/GSettings/fake_gsettings.h' | |||
297 | --- tests/mocks/GSettings/fake_gsettings.h 2013-07-26 13:28:08 +0000 | |||
298 | +++ tests/mocks/GSettings/fake_gsettings.h 1970-01-01 00:00:00 +0000 | |||
299 | @@ -1,90 +0,0 @@ | |||
300 | 1 | /* | ||
301 | 2 | * Copyright 2013 Canonical Ltd. | ||
302 | 3 | * | ||
303 | 4 | * This program is free software; you can redistribute it and/or modify | ||
304 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
305 | 6 | * the Free Software Foundation; version 3. | ||
306 | 7 | * | ||
307 | 8 | * This program is distributed in the hope that it will be useful, | ||
308 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
309 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
310 | 11 | * GNU Lesser General Public License for more details. | ||
311 | 12 | * | ||
312 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
313 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
314 | 15 | */ | ||
315 | 16 | |||
316 | 17 | #ifndef FAKE_GSETTINGS_H | ||
317 | 18 | #define FAKE_GSETTINGS_H | ||
318 | 19 | |||
319 | 20 | #include <QList> | ||
320 | 21 | #include <QtQml> | ||
321 | 22 | |||
322 | 23 | class GSettingsSchemaQml: public QObject | ||
323 | 24 | { | ||
324 | 25 | Q_OBJECT | ||
325 | 26 | |||
326 | 27 | Q_PROPERTY(QByteArray id READ id WRITE setId) | ||
327 | 28 | |||
328 | 29 | public: | ||
329 | 30 | GSettingsSchemaQml(QObject *parent = NULL); | ||
330 | 31 | |||
331 | 32 | QByteArray id() const; | ||
332 | 33 | void setId(const QByteArray &id); | ||
333 | 34 | |||
334 | 35 | QByteArray path() const; | ||
335 | 36 | void setPath(const QByteArray &path); | ||
336 | 37 | |||
337 | 38 | private: | ||
338 | 39 | QByteArray m_id; | ||
339 | 40 | QByteArray m_path; | ||
340 | 41 | }; | ||
341 | 42 | |||
342 | 43 | class GSettingsQml: public QObject | ||
343 | 44 | { | ||
344 | 45 | Q_OBJECT | ||
345 | 46 | |||
346 | 47 | Q_PROPERTY(GSettingsSchemaQml* schema READ schema NOTIFY schemaChanged) | ||
347 | 48 | Q_PROPERTY(QString pictureUri READ pictureUri WRITE setPictureUri NOTIFY pictureUriChanged) | ||
348 | 49 | |||
349 | 50 | public: | ||
350 | 51 | GSettingsQml(QObject *parent = NULL); | ||
351 | 52 | ~GSettingsQml(); | ||
352 | 53 | |||
353 | 54 | GSettingsSchemaQml * schema() const; | ||
354 | 55 | QString pictureUri() const; | ||
355 | 56 | |||
356 | 57 | void setPictureUri(const QString &str); | ||
357 | 58 | |||
358 | 59 | Q_SIGNALS: | ||
359 | 60 | void schemaChanged(); | ||
360 | 61 | void pictureUriChanged(const QString&); | ||
361 | 62 | |||
362 | 63 | private: | ||
363 | 64 | GSettingsSchemaQml* m_schema; | ||
364 | 65 | |||
365 | 66 | QString m_pictureUri; | ||
366 | 67 | |||
367 | 68 | friend class GSettingsSchemaQml; | ||
368 | 69 | }; | ||
369 | 70 | |||
370 | 71 | class GSettingsControllerQml: public QObject | ||
371 | 72 | { | ||
372 | 73 | Q_OBJECT | ||
373 | 74 | |||
374 | 75 | public: | ||
375 | 76 | static GSettingsControllerQml* instance(); | ||
376 | 77 | ~GSettingsControllerQml(); | ||
377 | 78 | |||
378 | 79 | void registerSettingsObject(GSettingsQml *obj); | ||
379 | 80 | void unRegisterSettingsObject(GSettingsQml *obj); | ||
380 | 81 | Q_INVOKABLE void setPictureUri(const QString &str); | ||
381 | 82 | |||
382 | 83 | private: | ||
383 | 84 | GSettingsControllerQml(); | ||
384 | 85 | |||
385 | 86 | static GSettingsControllerQml* s_controllerInstance; | ||
386 | 87 | QList<GSettingsQml *> m_registeredGSettings; | ||
387 | 88 | }; | ||
388 | 89 | |||
389 | 90 | #endif // FAKE_GSETTINGS_H | ||
390 | 91 | 0 | ||
391 | === removed file 'tests/mocks/GSettings/plugin.cpp' | |||
392 | --- tests/mocks/GSettings/plugin.cpp 2013-07-25 17:06:05 +0000 | |||
393 | +++ tests/mocks/GSettings/plugin.cpp 1970-01-01 00:00:00 +0000 | |||
394 | @@ -1,33 +0,0 @@ | |||
395 | 1 | /* | ||
396 | 2 | * Copyright (C) 2013 Canonical, Ltd. | ||
397 | 3 | * | ||
398 | 4 | * This program is free software; you can redistribute it and/or modify | ||
399 | 5 | * it under the terms of the GNU General Public License as published by | ||
400 | 6 | * the Free Software Foundation; version 3. | ||
401 | 7 | * | ||
402 | 8 | * This program is distributed in the hope that it will be useful, | ||
403 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
404 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
405 | 11 | * GNU General Public License for more details. | ||
406 | 12 | * | ||
407 | 13 | * You should have received a copy of the GNU General Public License | ||
408 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
409 | 15 | */ | ||
410 | 16 | |||
411 | 17 | #include "plugin.h" | ||
412 | 18 | #include "fake_gsettings.h" | ||
413 | 19 | |||
414 | 20 | #include <QtQml> | ||
415 | 21 | |||
416 | 22 | static QObject* controllerProvider(QQmlEngine* /* engine */, QJSEngine* /* scriptEngine */) | ||
417 | 23 | { | ||
418 | 24 | return GSettingsControllerQml::instance(); | ||
419 | 25 | } | ||
420 | 26 | |||
421 | 27 | void FakeGSettingsQmlPlugin::registerTypes(const char *uri) | ||
422 | 28 | { | ||
423 | 29 | qmlRegisterSingletonType<GSettingsControllerQml>(uri, 1, 0, "GSettingsController", controllerProvider); | ||
424 | 30 | qmlRegisterType<GSettingsQml>(uri, 1, 0, "GSettings"); | ||
425 | 31 | qmlRegisterUncreatableType<GSettingsSchemaQml>(uri, 1, 0, "GSettingsSchema", | ||
426 | 32 | "GSettingsSchema can only be used inside of a GSettings component"); | ||
427 | 33 | } | ||
428 | 34 | 0 | ||
429 | === removed file 'tests/mocks/GSettings/plugin.h' | |||
430 | --- tests/mocks/GSettings/plugin.h 2013-07-25 16:41:29 +0000 | |||
431 | +++ tests/mocks/GSettings/plugin.h 1970-01-01 00:00:00 +0000 | |||
432 | @@ -1,31 +0,0 @@ | |||
433 | 1 | /* | ||
434 | 2 | * Copyright (C) 2013 Canonical, Ltd. | ||
435 | 3 | * | ||
436 | 4 | * This program is free software; you can redistribute it and/or modify | ||
437 | 5 | * it under the terms of the GNU General Public License as published by | ||
438 | 6 | * the Free Software Foundation; version 3. | ||
439 | 7 | * | ||
440 | 8 | * This program is distributed in the hope that it will be useful, | ||
441 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
442 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
443 | 11 | * GNU General Public License for more details. | ||
444 | 12 | * | ||
445 | 13 | * You should have received a copy of the GNU General Public License | ||
446 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
447 | 15 | */ | ||
448 | 16 | |||
449 | 17 | #ifndef PLUGIN_H | ||
450 | 18 | #define PLUGIN_H | ||
451 | 19 | |||
452 | 20 | #include <QtQml/QQmlExtensionPlugin> | ||
453 | 21 | |||
454 | 22 | class FakeGSettingsQmlPlugin : public QQmlExtensionPlugin | ||
455 | 23 | { | ||
456 | 24 | Q_OBJECT | ||
457 | 25 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") | ||
458 | 26 | |||
459 | 27 | public: | ||
460 | 28 | void registerTypes(const char *uri); | ||
461 | 29 | }; | ||
462 | 30 | |||
463 | 31 | #endif // PLUGIN_H | ||
464 | 32 | 0 | ||
465 | === removed file 'tests/mocks/GSettings/qmldir' | |||
466 | --- tests/mocks/GSettings/qmldir 2013-07-25 09:21:51 +0000 | |||
467 | +++ tests/mocks/GSettings/qmldir 1970-01-01 00:00:00 +0000 | |||
468 | @@ -1,2 +0,0 @@ | |||
469 | 1 | module GSettings | ||
470 | 2 | plugin FakeGSettingsQml | ||
471 | 3 | 0 | ||
472 | === modified file 'tests/qmltests/CMakeLists.txt' | |||
473 | --- tests/qmltests/CMakeLists.txt 2013-07-26 11:10:55 +0000 | |||
474 | +++ tests/qmltests/CMakeLists.txt 2013-08-06 15:23:36 +0000 | |||
475 | @@ -26,7 +26,7 @@ | |||
476 | 26 | set(qmltest_DEFAULT_NO_ADD_TEST TRUE) | 26 | set(qmltest_DEFAULT_NO_ADD_TEST TRUE) |
477 | 27 | set(qmltest_DEFAULT_PROPERTIES "") | 27 | set(qmltest_DEFAULT_PROPERTIES "") |
478 | 28 | 28 | ||
480 | 29 | add_qml_test(. Shell IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks | 29 | add_qml_test(. Shell IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS} |
481 | 30 | ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/LightDM/single") | 30 | ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/LightDM/single") |
482 | 31 | add_manual_qml_test(Components DragHandle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins) | 31 | add_manual_qml_test(Components DragHandle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins) |
483 | 32 | add_qml_test(Components DraggingArea) | 32 | add_qml_test(Components DraggingArea) |
484 | 33 | 33 | ||
485 | === modified file 'tests/qmltests/tst_Shell.qml' | |||
486 | --- tests/qmltests/tst_Shell.qml 2013-08-02 16:16:31 +0000 | |||
487 | +++ tests/qmltests/tst_Shell.qml 2013-08-06 15:23:36 +0000 | |||
488 | @@ -19,7 +19,6 @@ | |||
489 | 19 | 19 | ||
490 | 20 | import QtQuick 2.0 | 20 | import QtQuick 2.0 |
491 | 21 | import QtTest 1.0 | 21 | import QtTest 1.0 |
492 | 22 | import GSettings 1.0 | ||
493 | 23 | import Ubuntu.Application 0.1 | 22 | import Ubuntu.Application 0.1 |
494 | 24 | import Unity.Test 0.1 as UT | 23 | import Unity.Test 0.1 as UT |
495 | 25 | 24 | ||
496 | @@ -278,18 +277,5 @@ | |||
497 | 278 | } | 277 | } |
498 | 279 | } while (!isStill); | 278 | } while (!isStill); |
499 | 280 | } | 279 | } |
500 | 281 | |||
501 | 282 | function test_wallpaper_data() { | ||
502 | 283 | return [ | ||
503 | 284 | {tag: "red", url: "tests/data/unity/backgrounds/red.png"}, | ||
504 | 285 | {tag: "blue", url: "tests/data/unity/backgrounds/blue.png"} | ||
505 | 286 | ] | ||
506 | 287 | } | ||
507 | 288 | |||
508 | 289 | function test_wallpaper(data) { | ||
509 | 290 | var backgroundImage = findChild(shell, "backgroundImage") | ||
510 | 291 | GSettingsController.setPictureUri(data.url) | ||
511 | 292 | tryCompareFunction(function() { return backgroundImage.source.toString().indexOf(data.url) !== -1; }, true) | ||
512 | 293 | } | ||
513 | 294 | } | 280 | } |
514 | 295 | } | 281 | } |
Tested and the problem is gone for me, let's see what the CI machines say