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

Proposed by Florian Boucault
Status: Merged
Approved by: Ugo Riboni
Approved revision: 351
Merged at revision: 354
Proposed branch: lp:~fboucault/camera-app/video_thumbnails
Merge into: lp:camera-app
Diff against target: 43 lines (+8/-0)
2 files modified
CameraApp/foldersmodel.cpp (+7/-0)
CameraApp/foldersmodel.h (+1/-0)
To merge this branch: bzr merge lp:~fboucault/camera-app/video_thumbnails
Reviewer Review Type Date Requested Status
Ugo Riboni (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+230361@code.launchpad.net

Commit message

Ensure video thumbnails are generated as soon as possible by monitoring changes to files themselves.

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
Ugo Riboni (uriboni) wrote :

Everything seems to be ok

review: Approve

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 2014-07-31 19:03:14 +0000
3+++ CameraApp/foldersmodel.cpp 2014-08-11 17:43:28 +0000
4@@ -25,6 +25,7 @@
5 {
6 m_watcher = new QFileSystemWatcher(this);
7 connect(m_watcher, SIGNAL(directoryChanged(QString)), this, SLOT(directoryChanged(QString)));
8+ connect(m_watcher, SIGNAL(fileChanged(QString)), this, SLOT(fileChanged(QString)));
9 }
10
11 QStringList FoldersModel::folders() const
12@@ -83,6 +84,7 @@
13 QFileInfoList fileInfoList = currentDir.entryInfoList(QDir::Files | QDir::Readable,
14 QDir::Time | QDir::Reversed);
15 Q_FOREACH (QFileInfo fileInfo, fileInfoList) {
16+ m_watcher->addPath(fileInfo.absoluteFilePath());
17 QString type = m_mimeDatabase.mimeTypeForFile(fileInfo).name();
18 Q_FOREACH (QString filterType, m_typeFilters) {
19 if (type.startsWith(filterType)) {
20@@ -178,6 +180,11 @@
21 updateFileInfoList();
22 }
23
24+void FoldersModel::fileChanged(const QString &filePath)
25+{
26+ updateFileInfoList();
27+}
28+
29 void FoldersModel::toggleSelected(int row)
30 {
31 if (m_selectedFiles.contains(row)) {
32
33=== modified file 'CameraApp/foldersmodel.h'
34--- CameraApp/foldersmodel.h 2014-07-31 19:03:14 +0000
35+++ CameraApp/foldersmodel.h 2014-08-11 17:43:28 +0000
36@@ -63,6 +63,7 @@
37
38 public Q_SLOTS:
39 void directoryChanged(const QString &directoryPath);
40+ void fileChanged(const QString &directoryPath);
41
42 Q_SIGNALS:
43 void foldersChanged();

Subscribers

People subscribed via source and target branches