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
=== modified file 'Components/CrossFadeImage.qml'
--- Components/CrossFadeImage.qml 2013-07-24 15:27:11 +0000
+++ Components/CrossFadeImage.qml 2013-08-06 15:23:36 +0000
@@ -85,7 +85,7 @@
85 Connections {85 Connections {
86 target: __nextImage86 target: __nextImage
87 onStatusChanged: {87 onStatusChanged: {
88 if (__nextImage.status == Image.Ready || __nextImage.status == Image.Error) {88 if (__nextImage.status == Image.Ready) {
89 swapImages();89 swapImages();
90 }90 }
91 }91 }
@@ -96,7 +96,6 @@
96 anchors.fill: parent96 anchors.fill: parent
97 cache: false97 cache: false
98 asynchronous: true98 asynchronous: true
99 fillMode: Image.PreserveAspectCrop
100 z: 199 z: 1
101 }100 }
102101
@@ -105,7 +104,6 @@
105 anchors.fill: parent104 anchors.fill: parent
106 cache: false105 cache: false
107 asynchronous: true106 asynchronous: true
108 fillMode: Image.PreserveAspectCrop
109 z: 0107 z: 0
110 }108 }
111109
112110
=== modified file 'Greeter/GreeterContent.qml'
--- Greeter/GreeterContent.qml 2013-08-02 16:16:31 +0000
+++ Greeter/GreeterContent.qml 2013-08-06 15:23:36 +0000
@@ -37,6 +37,7 @@
3737
38 source: shell.background38 source: shell.background
39 anchors.fill: parent39 anchors.fill: parent
40 crossFade: false
40 fadeInFirst: false41 fadeInFirst: false
41 }42 }
4243
4344
=== modified file 'Shell.qml'
--- Shell.qml 2013-08-02 19:10:00 +0000
+++ Shell.qml 2013-08-06 15:23:36 +0000
@@ -15,7 +15,6 @@
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.0
18import GSettings 1.0
19import Ubuntu.Application 0.118import Ubuntu.Application 0.1
20import Ubuntu.Components 0.119import Ubuntu.Components 0.1
21import Ubuntu.Gestures 0.120import Ubuntu.Gestures 0.1
@@ -42,8 +41,8 @@
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)
4342
44 property real edgeSize: units.gu(2)43 property real edgeSize: units.gu(2)
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"
46 property url background: backgroundSettings.pictureUri45 property url background: default_background
47 readonly property real panelHeight: panel.panelHeight46 readonly property real panelHeight: panel.panelHeight
4847
49 property bool dashShown: dash.shown48 property bool dashShown: dash.shown
@@ -116,11 +115,6 @@
116 }115 }
117 }116 }
118117
119 GSettings {
120 id: backgroundSettings
121 schema.id: "org.gnome.desktop.background"
122 }
123
124 VolumeControl {118 VolumeControl {
125 id: volumeControl119 id: volumeControl
126 }120 }
@@ -145,16 +139,12 @@
145 // through the translucent parts of the shell surface.139 // through the translucent parts of the shell surface.
146 visible: !fullyCovered && !applicationSurfaceShouldBeSeen140 visible: !fullyCovered && !applicationSurfaceShouldBeSeen
147141
148 CrossFadeImage {142 Image {
149 id: backgroundImage143 id: backgroundImage
150 objectName: "backgroundImage"
151 source: shell.background144 source: shell.background
145 sourceSize.width: parent.width
146 sourceSize.height: parent.height
152 anchors.fill: parent147 anchors.fill: parent
153 onStatusChanged: {
154 if (status == Image.Error) {
155 backgroundSettings.pictureUri = shell.defaultBackground
156 }
157 }
158 }148 }
159149
160 Rectangle {150 Rectangle {
@@ -199,6 +189,7 @@
199 }189 }
200 }190 }
201191
192
202 Item {193 Item {
203 id: stagesOuterContainer194 id: stagesOuterContainer
204195
@@ -263,6 +254,7 @@
263 ignoreUnknownSignals: true254 ignoreUnknownSignals: true
264 }255 }
265256
257
266 Stage {258 Stage {
267 id: mainStage259 id: mainStage
268260
@@ -438,7 +430,7 @@
438 onUnlocked: greeter.hide()430 onUnlocked: greeter.hide()
439 onSelected: {431 onSelected: {
440 var bgPath = greeter.model.data(uid, LightDM.UserRoles.BackgroundPathRole)432 var bgPath = greeter.model.data(uid, LightDM.UserRoles.BackgroundPathRole)
441 shell.background = bgPath ? bgPath : defaultBackground433 shell.background = bgPath ? bgPath : default_background
442 }434 }
443435
444 onLeftTeaserPressedChanged: {436 onLeftTeaserPressedChanged: {
445437
=== modified file 'debian/control'
--- debian/control 2013-08-02 16:16:31 +0000
+++ debian/control 2013-08-06 15:23:36 +0000
@@ -56,10 +56,8 @@
5656
57Package: unity857Package: unity8
58Architecture: any58Architecture: any
59Depends: gsettings-desktop-schemas,59Depends: qmenumodel-qml,
60 qmenumodel-qml,
61 qtdeclarative5-dee-plugin,60 qtdeclarative5-dee-plugin,
62 qtdeclarative5-gsettings1.0,
63 qtdeclarative5-ubuntu-ui-toolkit-plugin,61 qtdeclarative5-ubuntu-ui-toolkit-plugin,
64 qtdeclarative5-unity-notifications-plugin | unity-notifications-impl,62 qtdeclarative5-unity-notifications-plugin | unity-notifications-impl,
65 qtdeclarative5-xmllistmodel-plugin,63 qtdeclarative5-xmllistmodel-plugin,
6664
=== removed directory 'tests/data/unity/backgrounds'
=== removed file 'tests/data/unity/backgrounds/blue.png'
67Binary 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 differ65Binary 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
=== removed file 'tests/data/unity/backgrounds/red.png'
68Binary 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 differ66Binary 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
=== modified file 'tests/mocks/CMakeLists.txt'
--- tests/mocks/CMakeLists.txt 2013-07-26 11:10:55 +0000
+++ tests/mocks/CMakeLists.txt 2013-08-06 15:23:36 +0000
@@ -1,4 +1,3 @@
1add_subdirectory(GSettings)
2add_subdirectory(libusermetrics)1add_subdirectory(libusermetrics)
3add_subdirectory(LightDM)2add_subdirectory(LightDM)
4add_subdirectory(QMenuModel)3add_subdirectory(QMenuModel)
54
=== removed directory 'tests/mocks/GSettings'
=== removed file 'tests/mocks/GSettings/CMakeLists.txt'
--- tests/mocks/GSettings/CMakeLists.txt 2013-07-25 16:41:29 +0000
+++ tests/mocks/GSettings/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,31 +0,0 @@
1set(CMAKE_AUTOMOC ON)
2
3include(FindPkgConfig)
4find_package(Qt5Core REQUIRED)
5find_package(Qt5Quick REQUIRED)
6
7include_directories(
8 ${CMAKE_CURRENT_BINARY_DIR}
9 ${Qt5Core_INCLUDE_DIRS}
10 ${Qt5Quick_INCLUDE_DIRS}
11)
12
13add_definitions(-DQT_NO_KEYWORDS)
14
15set(GSettingsQML_SOURCES
16 fake_gsettings.cpp
17 plugin.cpp
18)
19
20add_library(FakeGSettingsQml MODULE ${GSettingsQML_SOURCES})
21target_link_libraries(FakeGSettingsQml
22 ${Qt5Core_LIBRARIES}
23 ${Qt5Quick_LIBRARIES}
24)
25
26qt5_use_modules(FakeGSettingsQml Qml)
27
28# copy qmldir file into build directory for shadow builds
29file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
30 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
31 )
320
=== removed file 'tests/mocks/GSettings/fake_gsettings.cpp'
--- tests/mocks/GSettings/fake_gsettings.cpp 2013-07-26 13:27:28 +0000
+++ tests/mocks/GSettings/fake_gsettings.cpp 1970-01-01 00:00:00 +0000
@@ -1,102 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "fake_gsettings.h"
18
19#include <QList>
20
21GSettingsControllerQml* GSettingsControllerQml::s_controllerInstance = 0;
22
23GSettingsControllerQml::GSettingsControllerQml() {
24}
25
26GSettingsControllerQml::~GSettingsControllerQml() {
27 s_controllerInstance = 0;
28}
29
30GSettingsControllerQml* GSettingsControllerQml::instance() {
31 if(!s_controllerInstance) {
32 s_controllerInstance = new GSettingsControllerQml();
33 }
34 return s_controllerInstance;
35}
36
37void GSettingsControllerQml::registerSettingsObject(GSettingsQml *obj) {
38 m_registeredGSettings.append(obj);
39}
40
41void GSettingsControllerQml::unRegisterSettingsObject(GSettingsQml *obj) {
42 m_registeredGSettings.removeOne(obj);
43}
44
45void GSettingsControllerQml::setPictureUri(const QString &str) {
46 Q_FOREACH (GSettingsQml *obj, m_registeredGSettings) {
47 obj->setPictureUri(str);
48 }
49}
50
51GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) {
52}
53
54QByteArray GSettingsSchemaQml::id() const {
55 return m_id;
56}
57
58void GSettingsSchemaQml::setId(const QByteArray &id) {
59 if (m_id.isEmpty()) {
60 qWarning("GSettings.schema.id may only be set on construction");
61 return;
62 }
63
64 m_id = id;
65}
66
67QByteArray GSettingsSchemaQml::path() const {
68 return m_path;
69}
70
71void GSettingsSchemaQml::setPath(const QByteArray &path) {
72 if (m_path.isEmpty()) {
73 qWarning("GSettings.schema.path may only be set on construction");
74 return;
75 }
76
77 m_path = path;
78}
79
80GSettingsQml::GSettingsQml(QObject *parent): QObject(parent) {
81 m_schema = new GSettingsSchemaQml(this);
82 GSettingsControllerQml::instance()->registerSettingsObject(this);
83}
84
85GSettingsQml::~GSettingsQml() {
86 GSettingsControllerQml::instance()->unRegisterSettingsObject(this);
87}
88
89GSettingsSchemaQml * GSettingsQml::schema() const {
90 return m_schema;
91}
92
93QString GSettingsQml::pictureUri() const {
94 return m_pictureUri;
95}
96
97void GSettingsQml::setPictureUri(const QString &str) {
98 if (str != m_pictureUri) {
99 m_pictureUri = str;
100 Q_EMIT pictureUriChanged(m_pictureUri);
101 }
102}
1030
=== removed file 'tests/mocks/GSettings/fake_gsettings.h'
--- tests/mocks/GSettings/fake_gsettings.h 2013-07-26 13:28:08 +0000
+++ tests/mocks/GSettings/fake_gsettings.h 1970-01-01 00:00:00 +0000
@@ -1,90 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef FAKE_GSETTINGS_H
18#define FAKE_GSETTINGS_H
19
20#include <QList>
21#include <QtQml>
22
23class GSettingsSchemaQml: public QObject
24{
25 Q_OBJECT
26
27 Q_PROPERTY(QByteArray id READ id WRITE setId)
28
29public:
30 GSettingsSchemaQml(QObject *parent = NULL);
31
32 QByteArray id() const;
33 void setId(const QByteArray &id);
34
35 QByteArray path() const;
36 void setPath(const QByteArray &path);
37
38private:
39 QByteArray m_id;
40 QByteArray m_path;
41};
42
43class GSettingsQml: public QObject
44{
45 Q_OBJECT
46
47 Q_PROPERTY(GSettingsSchemaQml* schema READ schema NOTIFY schemaChanged)
48 Q_PROPERTY(QString pictureUri READ pictureUri WRITE setPictureUri NOTIFY pictureUriChanged)
49
50public:
51 GSettingsQml(QObject *parent = NULL);
52 ~GSettingsQml();
53
54 GSettingsSchemaQml * schema() const;
55 QString pictureUri() const;
56
57 void setPictureUri(const QString &str);
58
59Q_SIGNALS:
60 void schemaChanged();
61 void pictureUriChanged(const QString&);
62
63private:
64 GSettingsSchemaQml* m_schema;
65
66 QString m_pictureUri;
67
68 friend class GSettingsSchemaQml;
69};
70
71class GSettingsControllerQml: public QObject
72{
73 Q_OBJECT
74
75public:
76 static GSettingsControllerQml* instance();
77 ~GSettingsControllerQml();
78
79 void registerSettingsObject(GSettingsQml *obj);
80 void unRegisterSettingsObject(GSettingsQml *obj);
81 Q_INVOKABLE void setPictureUri(const QString &str);
82
83private:
84 GSettingsControllerQml();
85
86 static GSettingsControllerQml* s_controllerInstance;
87 QList<GSettingsQml *> m_registeredGSettings;
88};
89
90#endif // FAKE_GSETTINGS_H
910
=== removed file 'tests/mocks/GSettings/plugin.cpp'
--- tests/mocks/GSettings/plugin.cpp 2013-07-25 17:06:05 +0000
+++ tests/mocks/GSettings/plugin.cpp 1970-01-01 00:00:00 +0000
@@ -1,33 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
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/>.
15 */
16
17#include "plugin.h"
18#include "fake_gsettings.h"
19
20#include <QtQml>
21
22static QObject* controllerProvider(QQmlEngine* /* engine */, QJSEngine* /* scriptEngine */)
23{
24 return GSettingsControllerQml::instance();
25}
26
27void FakeGSettingsQmlPlugin::registerTypes(const char *uri)
28{
29 qmlRegisterSingletonType<GSettingsControllerQml>(uri, 1, 0, "GSettingsController", controllerProvider);
30 qmlRegisterType<GSettingsQml>(uri, 1, 0, "GSettings");
31 qmlRegisterUncreatableType<GSettingsSchemaQml>(uri, 1, 0, "GSettingsSchema",
32 "GSettingsSchema can only be used inside of a GSettings component");
33}
340
=== removed file 'tests/mocks/GSettings/plugin.h'
--- tests/mocks/GSettings/plugin.h 2013-07-25 16:41:29 +0000
+++ tests/mocks/GSettings/plugin.h 1970-01-01 00:00:00 +0000
@@ -1,31 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
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/>.
15 */
16
17#ifndef PLUGIN_H
18#define PLUGIN_H
19
20#include <QtQml/QQmlExtensionPlugin>
21
22class FakeGSettingsQmlPlugin : public QQmlExtensionPlugin
23{
24 Q_OBJECT
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26
27public:
28 void registerTypes(const char *uri);
29};
30
31#endif // PLUGIN_H
320
=== removed file 'tests/mocks/GSettings/qmldir'
--- tests/mocks/GSettings/qmldir 2013-07-25 09:21:51 +0000
+++ tests/mocks/GSettings/qmldir 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
1module GSettings
2plugin FakeGSettingsQml
30
=== modified file 'tests/qmltests/CMakeLists.txt'
--- tests/qmltests/CMakeLists.txt 2013-07-26 11:10:55 +0000
+++ tests/qmltests/CMakeLists.txt 2013-08-06 15:23:36 +0000
@@ -26,7 +26,7 @@
26set(qmltest_DEFAULT_NO_ADD_TEST TRUE)26set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
27set(qmltest_DEFAULT_PROPERTIES "")27set(qmltest_DEFAULT_PROPERTIES "")
2828
29add_qml_test(. Shell IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks29add_qml_test(. Shell IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}
30 ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/LightDM/single")30 ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/LightDM/single")
31add_manual_qml_test(Components DragHandle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)31add_manual_qml_test(Components DragHandle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
32add_qml_test(Components DraggingArea)32add_qml_test(Components DraggingArea)
3333
=== modified file 'tests/qmltests/tst_Shell.qml'
--- tests/qmltests/tst_Shell.qml 2013-08-02 16:16:31 +0000
+++ tests/qmltests/tst_Shell.qml 2013-08-06 15:23:36 +0000
@@ -19,7 +19,6 @@
1919
20import QtQuick 2.020import QtQuick 2.0
21import QtTest 1.021import QtTest 1.0
22import GSettings 1.0
23import Ubuntu.Application 0.122import Ubuntu.Application 0.1
24import Unity.Test 0.1 as UT23import Unity.Test 0.1 as UT
2524
@@ -278,18 +277,5 @@
278 }277 }
279 } while (!isStill);278 } while (!isStill);
280 }279 }
281
282 function test_wallpaper_data() {
283 return [
284 {tag: "red", url: "tests/data/unity/backgrounds/red.png"},
285 {tag: "blue", url: "tests/data/unity/backgrounds/blue.png"}
286 ]
287 }
288
289 function test_wallpaper(data) {
290 var backgroundImage = findChild(shell, "backgroundImage")
291 GSettingsController.setPictureUri(data.url)
292 tryCompareFunction(function() { return backgroundImage.source.toString().indexOf(data.url) !== -1; }, true)
293 }
294 }280 }
295}281}

Subscribers

People subscribed via source and target branches