Merge lp:~artmello/gallery-app/gallery-app-ignore_dot_directories into lp:gallery-app

Proposed by Arthur Mello
Status: Merged
Approved by: Ugo Riboni
Approved revision: 954
Merged at revision: 955
Proposed branch: lp:~artmello/gallery-app/gallery-app-ignore_dot_directories
Merge into: lp:gallery-app
Diff against target: 47 lines (+15/-1)
2 files modified
src/media/media-monitor.cpp (+3/-1)
tests/unittests/mediamonitor/tst_mediamonitor.cpp (+12/-0)
To merge this branch: bzr merge lp:~artmello/gallery-app/gallery-app-ignore_dot_directories
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+215285@code.launchpad.net

Commit message

Make sure we do not monitor hidden directories

Description of the change

Make sure we do not monitor hidden directories

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

Update media monitor unittest

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Arthur Mello (artmello) wrote :

Are there any related MPs required for this MP to build/function as expected? Please list:
No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes):
Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?:
Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/gallery-app) on device or emulator?
Yes

If you changed the UI, was the change specified/approved by design?
No UI changes.

If you changed the packaging (debian), did you subscribe a core-dev to this MP?
No packaging changes.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/media/media-monitor.cpp'
2--- src/media/media-monitor.cpp 2014-03-28 15:34:24 +0000
3+++ src/media/media-monitor.cpp 2014-04-11 18:09:40 +0000
4@@ -172,7 +172,9 @@
5 // If it's a SymLink and points to a valid target need to get the target path
6 path = info.symLinkTarget();
7 }
8- if(!dirList.contains(path)) {
9+
10+ QFileInfo pathInfo(path);
11+ if(!dirList.contains(path) && !pathInfo.isHidden()) {
12 // In case we already visited the folder we didn't expand it anymore
13 dirStack.push(path);
14 }
15
16=== modified file 'tests/unittests/mediamonitor/tst_mediamonitor.cpp'
17--- tests/unittests/mediamonitor/tst_mediamonitor.cpp 2014-03-14 23:33:01 +0000
18+++ tests/unittests/mediamonitor/tst_mediamonitor.cpp 2014-04-11 18:09:40 +0000
19@@ -49,6 +49,13 @@
20 dir->mkpath("B/A");
21 dir->mkpath("B/B");
22
23+ // Create a hidden directory
24+ dir->mkpath(".H/A");
25+ dir->mkpath(".H/B");
26+
27+ // Create symlink
28+ QFile::link(m_tmpDir->path() + "/.H", m_tmpDir->path() + "L");
29+
30 // Create sample image
31 m_sampleImage = new QImage(400, 600, QImage::Format_RGB32);
32 m_sampleImage->fill(QColor(Qt::red));
33@@ -68,9 +75,14 @@
34 m_sampleImage->save(m_tmpDir->path() + "/B/A/sample_BA.jpg", "JPG");
35 m_sampleImage->save(m_tmpDir->path() + "/B/B/sample_BB.jpg", "JPG");
36
37+ m_sampleImage->save(m_tmpDir->path() + "/.H/A/sample_HA.jpg", "JPG");
38+ m_sampleImage->save(m_tmpDir->path() + "/.H/B/sample_HB.jpg", "JPG");
39+
40 m_sampleImage->save(m_tmpDir->path() + "/A/sample_A.jpg", "JPG");
41 m_sampleImage->save(m_tmpDir->path() + "/B/sample_B.jpg", "JPG");
42
43+ m_sampleImage->save(m_tmpDir->path() + "/.H/sample_H.jpg", "JPG");
44+
45 m_sampleImage->save(m_tmpDir->path() + "/sample.jpg", "JPG");
46
47 QTRY_COMPARE_WITH_TIMEOUT(m_monitor->manifest().count(), 7, 10000);

Subscribers

People subscribed via source and target branches