QTfrontend/main.cpp
changeset 8323 ab0b618bdf13
parent 8316 89232b2fa1d6
child 8337 bf237f7f1d94
equal deleted inserted replaced
8322:50369fa5053b 8323:ab0b618bdf13
   173     }
   173     }
   174 
   174 
   175     if(parsedArgs.contains("config-dir"))
   175     if(parsedArgs.contains("config-dir"))
   176     {
   176     {
   177         QFileInfo f(parsedArgs["config-dir"]);
   177         QFileInfo f(parsedArgs["config-dir"]);
   178         *cConfigDir = f.absoluteFilePath();
   178         cfgdir->setPath(f.absoluteFilePath());
   179         custom_config = true;
   179         custom_config = true;
       
   180     }
       
   181     else
       
   182     {
       
   183         cfgdir->setPath(QDir::homePath());
       
   184         custom_config = false;
   180     }
   185     }
   181 
   186 
   182     app.setStyle(new QPlastiqueStyle());
   187     app.setStyle(new QPlastiqueStyle());
   183 
   188 
   184     QDateTime now = QDateTime::currentDateTime();
   189     QDateTime now = QDateTime::currentDateTime();
   188     Q_INIT_RESOURCE(hedgewars);
   193     Q_INIT_RESOURCE(hedgewars);
   189 
   194 
   190     qRegisterMetaType<HWTeam>("HWTeam");
   195     qRegisterMetaType<HWTeam>("HWTeam");
   191 
   196 
   192     // workaround over NSIS installer which modifies the install path
   197     // workaround over NSIS installer which modifies the install path
   193     bindir->cd("./");
   198     //bindir->cd("./");
   194 
   199     bindir->cd(QCoreApplication::applicationDirPath());
   195     if(cConfigDir->length() == 0)
   200 
   196         cfgdir->setPath(cfgdir->homePath());
   201     if(custom_config == false)
   197     else
       
   198         cfgdir->setPath(*cConfigDir);
       
   199 
       
   200     if(cConfigDir->length() == 0)
       
   201     {
   202     {
   202 #ifdef __APPLE__
   203 #ifdef __APPLE__
   203         checkForDir(cfgdir->absolutePath() + "/Library/Application Support/Hedgewars");
   204         checkForDir(cfgdir->absolutePath() + "/Library/Application Support/Hedgewars");
   204         cfgdir->cd("Library/Application Support/Hedgewars");
   205         cfgdir->cd("Library/Application Support/Hedgewars");
   205 #elif defined _WIN32
   206 #elif defined _WIN32