equal
deleted
inserted
replaced
71 QFileInfo f(parsedArgs["data-dir"]); |
71 QFileInfo f(parsedArgs["data-dir"]); |
72 if(!f.exists()) { |
72 if(!f.exists()) { |
73 qWarning() << "WARNING: Cannot open DATA_PATH=" << f.absoluteFilePath(); |
73 qWarning() << "WARNING: Cannot open DATA_PATH=" << f.absoluteFilePath(); |
74 } |
74 } |
75 *cDataDir = f.absoluteFilePath(); |
75 *cDataDir = f.absoluteFilePath(); |
|
76 custom_data = true; |
76 } |
77 } |
77 |
78 |
78 if(parsedArgs.contains("config-dir")) { |
79 if(parsedArgs.contains("config-dir")) { |
79 QFileInfo f(parsedArgs["config-dir"]); |
80 QFileInfo f(parsedArgs["config-dir"]); |
80 *cConfigDir = f.absoluteFilePath(); |
81 *cConfigDir = f.absoluteFilePath(); |
|
82 custom_config = true; |
81 } |
83 } |
82 |
84 |
83 app.setStyle(new QPlastiqueStyle); |
85 app.setStyle(new QPlastiqueStyle); |
84 |
86 |
85 QDateTime now = QDateTime::currentDateTime(); |
87 QDateTime now = QDateTime::currentDateTime(); |
408 app.installTranslator(&Translator); |
410 app.installTranslator(&Translator); |
409 } |
411 } |
410 |
412 |
411 // Win32 registry setup (used for xfire detection etc. - don't set it if we're running in "portable" mode with a custom config dir) |
413 // Win32 registry setup (used for xfire detection etc. - don't set it if we're running in "portable" mode with a custom config dir) |
412 #ifdef _WIN32 |
414 #ifdef _WIN32 |
413 if(cConfigDir->length() == 0) |
415 if(!custom_config) |
414 { |
416 { |
415 QSettings registry(QSettings::NativeFormat, QSettings::UserScope, "Hedgewars Project", "Hedgewars"); |
417 QSettings registry_hklm("HKEY_LOCAL_MACHINE", QSettings::NativeFormat); |
416 QFileInfo f(argv[0]); |
418 registry_hklm.setValue("Software/Hedgewars/Frontend", bindir->absolutePath().replace("/", "\\") + "\\hedgewars.exe"); |
417 registry.setValue("file", f.absoluteFilePath()); |
419 registry_hklm.setValue("Software/Hedgewars/Path", bindir->absolutePath().replace("/", "\\")); |
418 registry.setValue("path", f.absolutePath()); |
|
419 } |
420 } |
420 #endif |
421 #endif |
421 |
422 |
422 HWForm *Form = new HWForm(); |
423 HWForm *Form = new HWForm(); |
423 |
424 |