~artmello/gallery-app/gallery-app-convergence_fullscreen

« back to all changes in this revision

Viewing changes to rc/qml/OrganicView/OrganicMediaList.qml

  • Committer: CI Train Bot
  • Author(s): James Henstridge
  • Date: 2015-12-16 22:01:42 UTC
  • mfrom: (1233.2.3 gallery-thumbnail-mtime)
  • Revision ID: ci-train-bot@canonical.com-20151216220142-kb2s3sau1gfd1dzb
Use the file's last modified date for the "at" parameter when invoking the thumbnailer to avoid needlessly reloading thumbnails. Fixes: #1485490
Approved by: Arthur Mello

Show diffs side-by-side

added added

removed removed

Lines of Context:
174
174
                sourceFillMode: UbuntuShape.PreserveAspectCrop
175
175
                source: Image {
176
176
                    id: thumbImage
177
 
                    source: "image://thumbnailer/" + model.mediaSource.path + "?at=" + Date.now()
 
177
                    source: "image://thumbnailer/" + model.mediaSource.path + "?at=" + model.mediaSource.lastModified
178
178
                    asynchronous: true
179
179
 
180
180
                    /* The SDK thumbnailer respects the freedesktop.org standard and uses 128 for the small
188
188
                    fillMode: Image.PreserveAspectCrop
189
189
                }
190
190
 
191
 
                Connections {
192
 
                    target: model && model.mediaSource ? model.mediaSource : null
193
 
                    onDataChanged: {
194
 
                        // data changed but filename didn't, so we need to bypass the qml image
195
 
                        // cache by tacking a timestamp to the filename so sees it as different.
196
 
                        thumbImage.source = "image://thumbnailer/" + model.mediaSource.path + "?at=" + Date.now()
197
 
                    }
198
 
                }
199
 
 
200
191
                Image {
201
192
                    // Display a play icon if the thumbnail is from a video
202
193
                    source: "../../img/icon_play.png"