on xenial help sign in
Save memory
4934631Andrea Cimitan
Shell.qml+12−1
@@ -119,6 +119,9 @@ FocusScope {
119 }
119 }
120
120
121 function updateImage() {
121 function updateImage() {
122+ if (testImage.source == "")
123+ return
124+
122 if (testImage.status == Image.Ready) {
125 if (testImage.status == Image.Ready) {
123 if (shell.width / shell.height <= testImage.sourceSize.width / testImage.sourceSize.height) {
126 if (shell.width / shell.height <= testImage.sourceSize.width / testImage.sourceSize.height) {
124 backgroundImage.sourceSize.width = 0
127 backgroundImage.sourceSize.width = 0
@@ -133,12 +136,20 @@ FocusScope {
133 } else if (testImage.status == Image.Error) {
136 } else if (testImage.status == Image.Error) {
134 shell.background = shell.default_background
137 shell.background = shell.default_background
135 }
138 }
139+
140+ // unload testImage source to save memory
141+ testImage.source = ""
136 }
142 }
137
143
138 Image {
144 Image {
139 id: testImage
145 id: testImage
146+
140− source: backgroundSettings.pictureUri
147+ property url gsettingsImage: backgroundSettings.pictureUri
148+
149+ source: gsettingsImage
141 visible: false
150 visible: false
151+
152+ onGsettingsImageChanged: source = gsettingsImage
142 onStatusChanged: updateImage()
153 onStatusChanged: updateImage()
143 }
154 }
144
155