]> granicus.if.org Git - transmission/commitdiff
(trunk qt) #3938 "The default config directory isn't created by the Qt client" -...
authorJordan Lee <jordan@transmissionbt.com>
Sun, 23 Jan 2011 16:55:15 +0000 (16:55 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sun, 23 Jan 2011 16:55:15 +0000 (16:55 +0000)
Summary says it all. Patch by luksan with minor formatting changes (and, no doubt, a new bug) by me.

qt/app.cc

index 9d6131fc7d496123f32e4776fc9aa0b88f26407e..3d95a6104c1ae898509f859f5c0d851055878341 100644 (file)
--- a/qt/app.cc
+++ b/qt/app.cc
@@ -136,9 +136,15 @@ MyApp :: MyApp( int& argc, char ** argv ):
     }
 
     // set the fallback config dir
-    if( configDir == 0 )
+    if( configDir == 0 ) {
         configDir = tr_getDefaultConfigDir( MY_CONFIG_NAME );
 
+        // ensure the config directory exists
+        QDir dir( configDir );
+        if( !dir.exists() )
+            dir.mkpath( configDir );
+    }
+
     // is this the first time we've run transmission?
     const bool firstTime = !QFile(QDir(configDir).absoluteFilePath("settings.json")).exists();