Merge lp:~fboucault/qtubuntu-camera/ensure_directories_exist into lp:qtubuntu-camera

Proposed by Florian Boucault on 2014-07-31
Status: Merged
Approved by: Jim Hodapp on 2014-07-31
Approved revision: 104
Merged at revision: 104
Proposed branch: lp:~fboucault/qtubuntu-camera/ensure_directories_exist
Merge into: lp:qtubuntu-camera
Diff against target: 29 lines (+8/-2)
1 file modified
src/storagemanager.cpp (+8/-2)
To merge this branch: bzr merge lp:~fboucault/qtubuntu-camera/ensure_directories_exist
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve on 2014-07-31
Jim Hodapp (community) code 2014-07-31 Approve on 2014-07-31
Review via email: mp+229106@code.launchpad.net

Commit message

Make sure that video and picture directories exist before writing to them.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/storagemanager.cpp'
2--- src/storagemanager.cpp 2014-07-29 18:08:39 +0000
3+++ src/storagemanager.cpp 2014-07-31 19:18:38 +0000
4@@ -36,8 +36,11 @@
5 QString StorageManager::nextPhotoFileName(const QString &directoy)
6 {
7 m_directory = directoy;
8- if (m_directory.isEmpty())
9+ if (m_directory.isEmpty()) {
10 m_directory = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) + "/" + QCoreApplication::applicationName();
11+ QDir dir;
12+ dir.mkpath(m_directory);
13+ }
14
15 return nextMediaFileName(photoBase, photoExtension);
16 }
17@@ -45,8 +48,11 @@
18 QString StorageManager::nextVideoFileName(const QString &directoy)
19 {
20 m_directory = directoy;
21- if (m_directory.isEmpty())
22+ if (m_directory.isEmpty()) {
23 m_directory = QStandardPaths::writableLocation(QStandardPaths::MoviesLocation) + "/" + QCoreApplication::applicationName();
24+ QDir dir;
25+ dir.mkpath(m_directory);
26+ }
27
28 return nextMediaFileName(videoBase, videoExtension);
29 }

Subscribers

People subscribed via source and target branches