on xenial help sign in
Revert revision 161 that causes issues with invalid background.
2a526c6Michał Sawicz
Components/CrossFadeImage.qml+1−3
@@ -85,7 +85,7 @@ Item {
85 Connections {
85 Connections {
86 target: __nextImage
86 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 @@ Item {
96 anchors.fill: parent
96 anchors.fill: parent
97 cache: false
97 cache: false
98 asynchronous: true
98 asynchronous: true
99− fillMode: Image.PreserveAspectCrop
100 z: 1
99 z: 1
101 }
100 }
102
101
@@ -105,7 +104,6 @@ Item {
105 anchors.fill: parent
104 anchors.fill: parent
106 cache: false
105 cache: false
107 asynchronous: true
106 asynchronous: true
108− fillMode: Image.PreserveAspectCrop
109 z: 0
107 z: 0
110 }
108 }
111
109
Greeter/GreeterContent.qml+1
@@ -37,6 +37,7 @@ MouseArea {
37
37
38 source: shell.background
38 source: shell.background
39 anchors.fill: parent
39 anchors.fill: parent
40+ crossFade: false
40 fadeInFirst: false
41 fadeInFirst: false
41 }
42 }
42
43
Shell.qml+8−16
@@ -15,7 +15,6 @@
15 */
15 */
16
16
17import QtQuick 2.0
17import QtQuick 2.0
18−import GSettings 1.0
19import Ubuntu.Application 0.1
18import Ubuntu.Application 0.1
20import Ubuntu.Components 0.1
19import Ubuntu.Components 0.1
21import Ubuntu.Gestures 0.1
20import Ubuntu.Gestures 0.1
@@ -42,8 +41,8 @@ FocusScope {
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)
43
42
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.pictureUri
45+ property url background: default_background
47 readonly property real panelHeight: panel.panelHeight
46 readonly property real panelHeight: panel.panelHeight
48
47
49 property bool dashShown: dash.shown
48 property bool dashShown: dash.shown
@@ -116,11 +115,6 @@ FocusScope {
116 }
115 }
117 }
116 }
118
117
119− GSettings {
120− id: backgroundSettings
121− schema.id: "org.gnome.desktop.background"
122− }
123−
124 VolumeControl {
118 VolumeControl {
125 id: volumeControl
119 id: volumeControl
126 }
120 }
@@ -145,16 +139,12 @@ FocusScope {
145 // through the translucent parts of the shell surface.
139 // through the translucent parts of the shell surface.
146 visible: !fullyCovered && !applicationSurfaceShouldBeSeen
140 visible: !fullyCovered && !applicationSurfaceShouldBeSeen
147
141
148− CrossFadeImage {
142+ Image {
149 id: backgroundImage
143 id: backgroundImage
150− objectName: "backgroundImage"
151 source: shell.background
144 source: shell.background
145+ sourceSize.width: parent.width
146+ sourceSize.height: parent.height
152 anchors.fill: parent
147 anchors.fill: parent
153− onStatusChanged: {
154− if (status == Image.Error) {
155− backgroundSettings.pictureUri = shell.defaultBackground
156− }
157− }
158 }
148 }
159
149
160 Rectangle {
150 Rectangle {
@@ -199,6 +189,7 @@ FocusScope {
199 }
189 }
200 }
190 }
201
191
192+
202 Item {
193 Item {
203 id: stagesOuterContainer
194 id: stagesOuterContainer
204
195
@@ -263,6 +254,7 @@ FocusScope {
263 ignoreUnknownSignals: true
254 ignoreUnknownSignals: true
264 }
255 }
265
256
257+
266 Stage {
258 Stage {
267 id: mainStage
259 id: mainStage
268
260
@@ -438,7 +430,7 @@ FocusScope {
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 : defaultBackground
433+ shell.background = bgPath ? bgPath : default_background
442 }
434 }
443
435
444 onLeftTeaserPressedChanged: {
436 onLeftTeaserPressedChanged: {
debian/control+1−3
@@ -56,10 +56,8 @@ Description: Indicators client test application
56
56
57Package: unity8
57Package: unity8
58Architecture: any
58Architecture: any
59−Depends: gsettings-desktop-schemas,
60− qmenumodel-qml,
59+Depends: 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,
tests/data/unity/backgrounds/blue.pngdeleted

Binary file not shown.

tests/data/unity/backgrounds/red.pngdeleted

Binary file not shown.

tests/mocks/CMakeLists.txt−1
@@ -1,4 +1,3 @@
1−add_subdirectory(GSettings)
2add_subdirectory(libusermetrics)
1add_subdirectory(libusermetrics)
3add_subdirectory(LightDM)
2add_subdirectory(LightDM)
4add_subdirectory(QMenuModel)
3add_subdirectory(QMenuModel)
tests/mocks/GSettings/CMakeLists.txtdeleted−31
@@ -1,31 +0,0 @@
1−set(CMAKE_AUTOMOC ON)
2−
3−include(FindPkgConfig)
4−find_package(Qt5Core REQUIRED)
5−find_package(Qt5Quick REQUIRED)
6−
7−include_directories(
8− ${CMAKE_CURRENT_BINARY_DIR}
9− ${Qt5Core_INCLUDE_DIRS}
10− ${Qt5Quick_INCLUDE_DIRS}
11−)
12−
13−add_definitions(-DQT_NO_KEYWORDS)
14−
15−set(GSettingsQML_SOURCES
16− fake_gsettings.cpp
17− plugin.cpp
18−)
19−
20−add_library(FakeGSettingsQml MODULE ${GSettingsQML_SOURCES})
21−target_link_libraries(FakeGSettingsQml
22− ${Qt5Core_LIBRARIES}
23− ${Qt5Quick_LIBRARIES}
24−)
25−
26−qt5_use_modules(FakeGSettingsQml Qml)
27−
28−# copy qmldir file into build directory for shadow builds
29−file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
30− DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
31− )
tests/mocks/GSettings/fake_gsettings.cppdeleted−102
@@ -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−
21−GSettingsControllerQml* GSettingsControllerQml::s_controllerInstance = 0;
22−
23−GSettingsControllerQml::GSettingsControllerQml() {
24−}
25−
26−GSettingsControllerQml::~GSettingsControllerQml() {
27− s_controllerInstance = 0;
28−}
29−
30−GSettingsControllerQml* GSettingsControllerQml::instance() {
31− if(!s_controllerInstance) {
32− s_controllerInstance = new GSettingsControllerQml();
33− }
34− return s_controllerInstance;
35−}
36−
37−void GSettingsControllerQml::registerSettingsObject(GSettingsQml *obj) {
38− m_registeredGSettings.append(obj);
39−}
40−
41−void GSettingsControllerQml::unRegisterSettingsObject(GSettingsQml *obj) {
42− m_registeredGSettings.removeOne(obj);
43−}
44−
45−void GSettingsControllerQml::setPictureUri(const QString &str) {
46− Q_FOREACH (GSettingsQml *obj, m_registeredGSettings) {
47− obj->setPictureUri(str);
48− }
49−}
50−
51−GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) {
52−}
53−
54−QByteArray GSettingsSchemaQml::id() const {
55− return m_id;
56−}
57−
58−void 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−
67−QByteArray GSettingsSchemaQml::path() const {
68− return m_path;
69−}
70−
71−void 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−
80−GSettingsQml::GSettingsQml(QObject *parent): QObject(parent) {
81− m_schema = new GSettingsSchemaQml(this);
82− GSettingsControllerQml::instance()->registerSettingsObject(this);
83−}
84−
85−GSettingsQml::~GSettingsQml() {
86− GSettingsControllerQml::instance()->unRegisterSettingsObject(this);
87−}
88−
89−GSettingsSchemaQml * GSettingsQml::schema() const {
90− return m_schema;
91−}
92−
93−QString GSettingsQml::pictureUri() const {
94− return m_pictureUri;
95−}
96−
97−void GSettingsQml::setPictureUri(const QString &str) {
98− if (str != m_pictureUri) {
99− m_pictureUri = str;
100− Q_EMIT pictureUriChanged(m_pictureUri);
101− }
102−}
tests/mocks/GSettings/fake_gsettings.hdeleted−90
@@ -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−
23−class GSettingsSchemaQml: public QObject
24−{
25− Q_OBJECT
26−
27− Q_PROPERTY(QByteArray id READ id WRITE setId)
28−
29−public:
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−
38−private:
39− QByteArray m_id;
40− QByteArray m_path;
41−};
42−
43−class 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−
50−public:
51− GSettingsQml(QObject *parent = NULL);
52− ~GSettingsQml();
53−
54− GSettingsSchemaQml * schema() const;
55− QString pictureUri() const;
56−
57− void setPictureUri(const QString &str);
58−
59−Q_SIGNALS:
60− void schemaChanged();
61− void pictureUriChanged(const QString&);
62−
63−private:
64− GSettingsSchemaQml* m_schema;
65−
66− QString m_pictureUri;
67−
68− friend class GSettingsSchemaQml;
69−};
70−
71−class GSettingsControllerQml: public QObject
72−{
73− Q_OBJECT
74−
75−public:
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−
83−private:
84− GSettingsControllerQml();
85−
86− static GSettingsControllerQml* s_controllerInstance;
87− QList<GSettingsQml *> m_registeredGSettings;
88−};
89−
90−#endif // FAKE_GSETTINGS_H
tests/mocks/GSettings/plugin.cppdeleted−33
@@ -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−
22−static QObject* controllerProvider(QQmlEngine* /* engine */, QJSEngine* /* scriptEngine */)
23−{
24− return GSettingsControllerQml::instance();
25−}
26−
27−void 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−}
tests/mocks/GSettings/plugin.hdeleted−31
@@ -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−
22−class FakeGSettingsQmlPlugin : public QQmlExtensionPlugin
23−{
24− Q_OBJECT
25− Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26−
27−public:
28− void registerTypes(const char *uri);
29−};
30−
31−#endif // PLUGIN_H
tests/mocks/GSettings/qmldirdeleted−2
@@ -1,2 +0,0 @@
1−module GSettings
2−plugin FakeGSettingsQml
tests/qmltests/CMakeLists.txt+1−1
@@ -26,7 +26,7 @@ set(qmltest_DEFAULT_TARGETS qmluitests)
26set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
26set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
27set(qmltest_DEFAULT_PROPERTIES "")
27set(qmltest_DEFAULT_PROPERTIES "")
28
28
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}
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)
tests/qmltests/tst_Shell.qml−14
@@ -19,7 +19,6 @@
19
19
20import QtQuick 2.0
20import QtQuick 2.0
21import QtTest 1.0
21import QtTest 1.0
22−import GSettings 1.0
23import Ubuntu.Application 0.1
22import Ubuntu.Application 0.1
24import Unity.Test 0.1 as UT
23import Unity.Test 0.1 as UT
25
24
@@ -278,18 +277,5 @@ Item {
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}