on xenial help sign in
Save memory
commit49346311a9dc082f6f5a770b499f98928f397b06 authorAndrea Cimitan <andrea.cimitan@canonical.com> dateTue 16 Jul 2013, 14:04 (13 years ago) parent8f3c263
1 file changed+12−1
Shell.qml+12−1
Shell.qml+12−1
@@ -119,6 +119,9 @@ FocusScope {
119119 }
120120
121121 function updateImage() {
122+ if (testImage.source == "")
123+ return
124+
122125 if (testImage.status == Image.Ready) {
123126 if (shell.width / shell.height <= testImage.sourceSize.width / testImage.sourceSize.height) {
124127 backgroundImage.sourceSize.width = 0
@@ -133,12 +136,20 @@ FocusScope {
133136 } else if (testImage.status == Image.Error) {
134137 shell.background = shell.default_background
135138 }
139+
140+ // unload testImage source to save memory
141+ testImage.source = ""
136142 }
137143
138144 Image {
139145 id: testImage
140− source: backgroundSettings.pictureUri
146+
147+ property url gsettingsImage: backgroundSettings.pictureUri
148+
149+ source: gsettingsImage
141150 visible: false
151+
152+ onGsettingsImageChanged: source = gsettingsImage
142153 onStatusChanged: updateImage()
143154 }
144155