on xenial help sign in
bring back the dummy image to check if wallpaper is valid
ead6a9fMichael Zanetti
Shell.qml+22−13
@@ -43,7 +43,7 @@ FocusScope {
43
43
44 property real edgeSize: units.gu(2)
44 property real edgeSize: units.gu(2)
45 property url defaultBackground: shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg"
45 property url defaultBackground: shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg"
46− readonly property alias background: backgroundImage.source
46+ property url background
47 readonly property real panelHeight: panel.panelHeight
47 readonly property real panelHeight: panel.panelHeight
48
48
49 property bool dashShown: dash.shown
49 property bool dashShown: dash.shown
@@ -119,6 +119,26 @@ FocusScope {
119 GSettings {
119 GSettings {
120 id: backgroundSettings
120 id: backgroundSettings
121 schema.id: "org.gnome.desktop.background"
121 schema.id: "org.gnome.desktop.background"
122+
123+ }
124+ property url gSettingsPicture: backgroundSettings.pictureUri.length > 0 ? backgroundSettings.pictureUri : shell.defaultBackground
125+ onGSettingsPictureChanged: {
126+ shell.background = gSettingsPicture
127+ }
128+
129+ // This is a dummy image that is needed to determine if the picture url
130+ // in backgroundSettings points to a valid picture file.
131+ Image {
132+ source: shell.background
133+ height: 0
134+ width: 0
135+ sourceSize.height: 0
136+ sourceSize.width: 0
137+ onStatusChanged: {
138+ if (status == Image.Error && source != shell.defaultBackground) {
139+ shell.background = defaultBackground
140+ }
141+ }
122 }
142 }
123
143
124 VolumeControl {
144 VolumeControl {
@@ -149,19 +169,8 @@ FocusScope {
149 id: backgroundImage
169 id: backgroundImage
150 objectName: "backgroundImage"
170 objectName: "backgroundImage"
151
171
152− property url gSettingsPicture: backgroundSettings.pictureUri.length > 0 ? backgroundSettings.pictureUri : defaultBackground
153−
154 anchors.fill: parent
172 anchors.fill: parent
155−
173+ source: shell.background
156− onGSettingsPictureChanged: {
157− source = gSettingsPicture
158− }
159−
160− onStatusChanged: {
161− if (status == Image.Error && source != defaultBackground) {
162− source = defaultBackground
163− }
164− }
165 }
174 }
166
175
167 Rectangle {
176 Rectangle {