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
1=== modified file 'CameraApp/foldersmodel.cpp'
2--- CameraApp/foldersmodel.cpp 2015-01-25 18:54:51 +0000
3+++ CameraApp/foldersmodel.cpp 2015-01-28 15:58:22 +0000
4@@ -275,6 +275,11 @@
5 m_fileInfoList[fileIndex] = fileInfo;
6 Q_EMIT dataChanged(modelIndex, modelIndex);
7 }
8+
9+ // As the documentation states, in some cases the watch is removed on a
10+ // fileChanged signal, so we will need to add it back again.
11+ // addPath() will safely do nothing if the file is still being watched.
12+ m_watcher->addPath(filePath);
13 } else {
14 // file has either been removed or renamed
15 if (fileIndex != -1) {
16
17=== modified file 'PhotogridView.qml'
18--- PhotogridView.qml 2015-01-24 13:05:54 +0000
19+++ PhotogridView.qml 2015-01-28 15:58:22 +0000
20@@ -111,7 +111,9 @@
21
22 asynchronous: true
23 cache: false
24- source: photogridView.inView ? "image://thumbnailer/" + fileURL.toString() : ""
25+ // The thumbnailer does not seem to check when an image has been changed on disk,
26+ // so we use this hack to force it to check and refresh if necessary.
27+ source: photogridView.inView ? "image://thumbnailer/" + fileURL.toString() + "?at=" + Date.now() : ""
28 sourceSize {
29 width: width
30 height: height

Subscribers

People subscribed via source and target branches