[Pkg-owncloud-commits] [owncloud-client] 105/171: ConfigFile: Create the directory when using --confdir and it does not exist

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Feb 17 09:36:56 UTC 2016


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to annotated tag upstream/2.1.1+dfsg
in repository owncloud-client.

commit 272755e1ec4856f3baa32bb6269c73feef6cbbd5
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Wed Jan 13 10:31:02 2016 +0100

    ConfigFile: Create the directory when using --confdir and it does not exist
    
    Previously we would fail to start if the directory was not existing.
    This was working for relative directory, but it should also work for
    absolute ones
    
    https://github.com/owncloud/enterprise/issues/970
---
 src/libsync/configfile.cpp | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/libsync/configfile.cpp b/src/libsync/configfile.cpp
index 2917be1..af54772 100644
--- a/src/libsync/configfile.cpp
+++ b/src/libsync/configfile.cpp
@@ -95,11 +95,9 @@ bool ConfigFile::setConfDir(const QString &value)
     if( dirPath.isEmpty() ) return false;
 
     QFileInfo fi(dirPath);
-    if ( !fi.exists() && !fi.isAbsolute() ) {
-        QDir::current().mkdir(dirPath);
-        QDir dir = QDir::current();
-        dir.cd(dirPath);
-        fi.setFile(dir.path());
+    if ( !fi.exists()  ) {
+        QDir().mkpath(dirPath);
+        fi.setFile(dirPath);
     }
     if( fi.exists() && fi.isDir() ) {
         dirPath = fi.absoluteFilePath();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list