Merge lp:~fboucault/camera-app/fix_taking_pic_while_scanning into lp:camera-app

Proposed by Florian Boucault
Status: Merged
Approved by: Bill Filler
Approved revision: 478
Merged at revision: 478
Proposed branch: lp:~fboucault/camera-app/fix_taking_pic_while_scanning
Merge into: lp:camera-app
Diff against target: 46 lines (+10/-3)
3 files modified
CameraApp/foldersmodel.cpp (+8/-1)
CameraApp/foldersmodel.h (+1/-1)
GalleryView.qml (+1/-1)
To merge this branch: bzr merge lp:~fboucault/camera-app/fix_taking_pic_while_scanning
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Bill Filler Pending
Review via email: mp+247534@code.launchpad.net

Commit message

Fix case when pictures have been taken while the library is being scanned.

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

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-24 17:52:55 +0000
3+++ CameraApp/foldersmodel.cpp 2015-01-25 19:05:38 +0000
4@@ -144,8 +144,15 @@
5 setFileInfoList(result.first, result.second);
6 }
7
8-void FoldersModel::setFileInfoList(const QFileInfoList& fileInfoList, const QStringList& filesToWatch)
9+void FoldersModel::setFileInfoList(QFileInfoList fileInfoList, const QStringList& filesToWatch)
10 {
11+ // prepend files that have been added while the list was computed
12+ Q_FOREACH (QFileInfo fileInfo, m_fileInfoList) {
13+ if(!fileInfoList.contains(fileInfo)) {
14+ fileInfoList.prepend(fileInfo);
15+ }
16+ }
17+
18 beginResetModel();
19 m_fileInfoList = fileInfoList;
20 endResetModel();
21
22=== modified file 'CameraApp/foldersmodel.h'
23--- CameraApp/foldersmodel.h 2015-01-24 17:52:55 +0000
24+++ CameraApp/foldersmodel.h 2015-01-25 19:05:38 +0000
25@@ -61,7 +61,7 @@
26 QPair<QFileInfoList, QStringList> computeFileInfoList(QStringList folders);
27 bool fileMatchesTypeFilters(const QFileInfo& newFileInfo);
28 void insertFileInfo(const QFileInfo& newFileInfo);
29- void setFileInfoList(const QFileInfoList& fileInfoList, const QStringList& filesToWatch);
30+ void setFileInfoList(QFileInfoList fileInfoList, const QStringList& filesToWatch);
31
32 QHash<int, QByteArray> roleNames() const;
33 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
34
35=== modified file 'GalleryView.qml'
36--- GalleryView.qml 2015-01-24 17:52:55 +0000
37+++ GalleryView.qml 2015-01-25 19:05:38 +0000
38@@ -193,7 +193,7 @@
39 Rectangle {
40 objectName: "scanningMediaHint"
41 anchors.fill: parent
42- visible: model.loading
43+ visible: model.count === 0 && model.loading
44 color: "#0F0F0F"
45
46 Icon {

Subscribers

People subscribed via source and target branches