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
=== modified file 'src/media/media-monitor.cpp'
--- src/media/media-monitor.cpp 2014-03-28 15:34:24 +0000
+++ src/media/media-monitor.cpp 2014-04-11 18:09:40 +0000
@@ -172,7 +172,9 @@
172 // If it's a SymLink and points to a valid target need to get the target path172 // If it's a SymLink and points to a valid target need to get the target path
173 path = info.symLinkTarget();173 path = info.symLinkTarget();
174 }174 }
175 if(!dirList.contains(path)) {175
176 QFileInfo pathInfo(path);
177 if(!dirList.contains(path) && !pathInfo.isHidden()) {
176 // In case we already visited the folder we didn't expand it anymore178 // In case we already visited the folder we didn't expand it anymore
177 dirStack.push(path);179 dirStack.push(path);
178 }180 }
179181
=== modified file 'tests/unittests/mediamonitor/tst_mediamonitor.cpp'
--- tests/unittests/mediamonitor/tst_mediamonitor.cpp 2014-03-14 23:33:01 +0000
+++ tests/unittests/mediamonitor/tst_mediamonitor.cpp 2014-04-11 18:09:40 +0000
@@ -49,6 +49,13 @@
49 dir->mkpath("B/A");49 dir->mkpath("B/A");
50 dir->mkpath("B/B");50 dir->mkpath("B/B");
5151
52 // Create a hidden directory
53 dir->mkpath(".H/A");
54 dir->mkpath(".H/B");
55
56 // Create symlink
57 QFile::link(m_tmpDir->path() + "/.H", m_tmpDir->path() + "L");
58
52 // Create sample image59 // Create sample image
53 m_sampleImage = new QImage(400, 600, QImage::Format_RGB32);60 m_sampleImage = new QImage(400, 600, QImage::Format_RGB32);
54 m_sampleImage->fill(QColor(Qt::red));61 m_sampleImage->fill(QColor(Qt::red));
@@ -68,9 +75,14 @@
68 m_sampleImage->save(m_tmpDir->path() + "/B/A/sample_BA.jpg", "JPG");75 m_sampleImage->save(m_tmpDir->path() + "/B/A/sample_BA.jpg", "JPG");
69 m_sampleImage->save(m_tmpDir->path() + "/B/B/sample_BB.jpg", "JPG");76 m_sampleImage->save(m_tmpDir->path() + "/B/B/sample_BB.jpg", "JPG");
7077
78 m_sampleImage->save(m_tmpDir->path() + "/.H/A/sample_HA.jpg", "JPG");
79 m_sampleImage->save(m_tmpDir->path() + "/.H/B/sample_HB.jpg", "JPG");
80
71 m_sampleImage->save(m_tmpDir->path() + "/A/sample_A.jpg", "JPG");81 m_sampleImage->save(m_tmpDir->path() + "/A/sample_A.jpg", "JPG");
72 m_sampleImage->save(m_tmpDir->path() + "/B/sample_B.jpg", "JPG");82 m_sampleImage->save(m_tmpDir->path() + "/B/sample_B.jpg", "JPG");
7383
84 m_sampleImage->save(m_tmpDir->path() + "/.H/sample_H.jpg", "JPG");
85
74 m_sampleImage->save(m_tmpDir->path() + "/sample.jpg", "JPG");86 m_sampleImage->save(m_tmpDir->path() + "/sample.jpg", "JPG");
7587
76 QTRY_COMPARE_WITH_TIMEOUT(m_monitor->manifest().count(), 7, 10000);88 QTRY_COMPARE_WITH_TIMEOUT(m_monitor->manifest().count(), 7, 10000);

Subscribers

People subscribed via source and target branches