Merge lp:~phablet-team/camera-app/watch-refresh-thumbs into lp:camera-app

Proposed by Ugo Riboni
Status: Merged
Approved by: Bill Filler
Approved revision: 483
Merged at revision: 493
Proposed branch: lp:~phablet-team/camera-app/watch-refresh-thumbs
Merge into: lp:camera-app
Diff against target: 30 lines (+8/-1)
2 files modified
CameraApp/foldersmodel.cpp (+5/-0)
PhotogridView.qml (+3/-1)
To merge this branch: bzr merge lp:~phablet-team/camera-app/watch-refresh-thumbs
Reviewer Review Type Date Requested Status
Florian Boucault (community) Needs Fixing
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+247837@code.launchpad.net

Commit message

Refresh properly the thumbnails when the picture is changed. Make sure after the first change the file is still being watched.

Description of the change

Refresh properly the thumbnails when the picture is changed. Make sure after the first change the file is still being watched.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Florian Boucault (fboucault) wrote :

"?at=" + Date.now() makes it so that the thumbnail is _always_ recomputed even though the file might not have changed.

review: Needs Fixing
Revision history for this message
Florian Boucault (fboucault) wrote :

> "?at=" + Date.now() makes it so that the thumbnail is _always_ recomputed even
> though the file might not have changed.

Not sure about that anymore, my brain is failing. Let's discuss it ASAP

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CameraApp/foldersmodel.cpp'
--- CameraApp/foldersmodel.cpp 2015-01-25 18:54:51 +0000
+++ CameraApp/foldersmodel.cpp 2015-01-28 15:58:22 +0000
@@ -275,6 +275,11 @@
275 m_fileInfoList[fileIndex] = fileInfo;275 m_fileInfoList[fileIndex] = fileInfo;
276 Q_EMIT dataChanged(modelIndex, modelIndex);276 Q_EMIT dataChanged(modelIndex, modelIndex);
277 }277 }
278
279 // As the documentation states, in some cases the watch is removed on a
280 // fileChanged signal, so we will need to add it back again.
281 // addPath() will safely do nothing if the file is still being watched.
282 m_watcher->addPath(filePath);
278 } else {283 } else {
279 // file has either been removed or renamed284 // file has either been removed or renamed
280 if (fileIndex != -1) {285 if (fileIndex != -1) {
281286
=== modified file 'PhotogridView.qml'
--- PhotogridView.qml 2015-01-24 13:05:54 +0000
+++ PhotogridView.qml 2015-01-28 15:58:22 +0000
@@ -111,7 +111,9 @@
111 111
112 asynchronous: true112 asynchronous: true
113 cache: false113 cache: false
114 source: photogridView.inView ? "image://thumbnailer/" + fileURL.toString() : ""114 // The thumbnailer does not seem to check when an image has been changed on disk,
115 // so we use this hack to force it to check and refresh if necessary.
116 source: photogridView.inView ? "image://thumbnailer/" + fileURL.toString() + "?at=" + Date.now() : ""
115 sourceSize {117 sourceSize {
116 width: width118 width: width
117 height: height119 height: height

Subscribers

People subscribed via source and target branches