QTfrontend/main.cpp
changeset 8323 ab0b618bdf13
parent 8316 89232b2fa1d6
child 8337 bf237f7f1d94
--- a/QTfrontend/main.cpp	Mon Dec 24 03:00:18 2012 +0100
+++ b/QTfrontend/main.cpp	Mon Dec 24 15:41:45 2012 +0100
@@ -175,9 +175,14 @@
     if(parsedArgs.contains("config-dir"))
     {
         QFileInfo f(parsedArgs["config-dir"]);
-        *cConfigDir = f.absoluteFilePath();
+        cfgdir->setPath(f.absoluteFilePath());
         custom_config = true;
     }
+    else
+    {
+        cfgdir->setPath(QDir::homePath());
+        custom_config = false;
+    }
 
     app.setStyle(new QPlastiqueStyle());
 
@@ -190,14 +195,10 @@
     qRegisterMetaType<HWTeam>("HWTeam");
 
     // workaround over NSIS installer which modifies the install path
-    bindir->cd("./");
+    //bindir->cd("./");
+    bindir->cd(QCoreApplication::applicationDirPath());
 
-    if(cConfigDir->length() == 0)
-        cfgdir->setPath(cfgdir->homePath());
-    else
-        cfgdir->setPath(*cConfigDir);
-
-    if(cConfigDir->length() == 0)
+    if(custom_config == false)
     {
 #ifdef __APPLE__
         checkForDir(cfgdir->absolutePath() + "/Library/Application Support/Hedgewars");