From d38634a3f7617ea28b2764b2ec63806a42d88ff9 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Sun, 23 Jan 2011 16:55:15 +0000 Subject: [PATCH] (trunk qt) #3938 "The default config directory isn't created by the Qt client" -- fixed. Summary says it all. Patch by luksan with minor formatting changes (and, no doubt, a new bug) by me. --- qt/app.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qt/app.cc b/qt/app.cc index 9d6131fc7..3d95a6104 100644 --- 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();