Merge lp:~saviq/unity8/revert-background into lp:unity8

Proposed by Michał Sawicz
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
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: mp+178782@code.launchpad.net

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.

To post a comment you must log in.
Revision history for this message
Albert Astals Cid (aacid) wrote :

Tested and the problem is gone for me, let's see what the CI machines say

review: Approve (functional)
Revision history for this message
Gerry Boland (gerboland) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

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

Subscribers

People subscribed via source and target branches