on xenial help sign in
bring back the dummy image to check if wallpaper is valid

The caused binding loop seems to break some stuff indeed so we'll just break the dummy picture now instead of the real one.

commitead6a9f5900550567c4249203b877d5356640ecd authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 13 Aug 2013, 13:55 (13 years ago) parent0609c23
1 file changed+22−13
Shell.qml+22−13
Shell.qml+22−13
@@ -43,7 +43,7 @@ FocusScope {
4343
4444 property real edgeSize: units.gu(2)
4545 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
4747 readonly property real panelHeight: panel.panelHeight
4848
4949 property bool dashShown: dash.shown
@@ -119,6 +119,26 @@ FocusScope {
119119 GSettings {
120120 id: backgroundSettings
121121 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+ }
122142 }
123143
124144 VolumeControl {
@@ -149,19 +169,8 @@ FocusScope {
149169 id: backgroundImage
150170 objectName: "backgroundImage"
151171
152− property url gSettingsPicture: backgroundSettings.pictureUri.length > 0 ? backgroundSettings.pictureUri : defaultBackground
153−
154172 anchors.fill: parent
155−
156− onGSettingsPictureChanged: {
157− source = gSettingsPicture
158− }
159−
160− onStatusChanged: {
161− if (status == Image.Error && source != defaultBackground) {
162− source = defaultBackground
163− }
164− }
173+ source: shell.background
165174 }
166175
167176 Rectangle {