common: Ensure the custom config path is stored as an absolute path
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 29 May 2018 21:18:05 +0000 (23:18 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 6 Jun 2018 19:12:17 +0000 (21:12 +0200)
This prevents creation of a bogus and empty directory inside the
custom config directory if the path given by --configdir was
relative.

src/common/quassel.cpp

index 7ee7915..4e24ff0 100644 (file)
@@ -516,6 +516,8 @@ QString Quassel::configDirPath()
 #endif /* Q_OS_MAC */
     }
 
+    path = QFileInfo{path}.absoluteFilePath();
+
     if (!path.endsWith(QDir::separator()) && !path.endsWith('/'))
         path += QDir::separator();
 
@@ -528,7 +530,6 @@ QString Quassel::configDirPath()
     }
 
     instance()->_configDirPath = path;
-
     return path;
 }