equal
deleted
inserted
replaced
118 return false; |
118 return false; |
119 } |
119 } |
120 return true; |
120 return true; |
121 } |
121 } |
122 |
122 |
123 bool checkForFile(const QString & file) |
|
124 { |
|
125 QFile tmpfile(file); |
|
126 if (!tmpfile.exists()) |
|
127 return tmpfile.open(QFile::WriteOnly); |
|
128 else |
|
129 return true; |
|
130 } |
|
131 |
|
132 // Guaranteed to be the last thing ran in the application's life time. |
123 // Guaranteed to be the last thing ran in the application's life time. |
133 // Closes resources that need to exist as long as possible. |
124 // Closes resources that need to exist as long as possible. |
134 void closeResources(void) |
125 void closeResources(void) |
135 { |
126 { |
136 #ifdef __APPLE__ |
127 #ifdef __APPLE__ |
294 engine->mount(cfgdir->absolutePath() + "/Data"); |
285 engine->mount(cfgdir->absolutePath() + "/Data"); |
295 engine->mount(cfgdir->absolutePath()); |
286 engine->mount(cfgdir->absolutePath()); |
296 engine->setWriteDir(cfgdir->absolutePath()); |
287 engine->setWriteDir(cfgdir->absolutePath()); |
297 engine->mountPacks(); |
288 engine->mountPacks(); |
298 |
289 |
299 checkForFile("physfs://hedgewars.ini"); |
290 DataManager::ensureFileExists("physfs://hedgewars.ini"); |
300 |
291 |
301 QTranslator Translator; |
292 QTranslator Translator; |
302 { |
293 { |
303 QSettings settings("physfs://hedgewars.ini", QSettings::IniFormat); |
294 QSettings settings("physfs://hedgewars.ini", QSettings::IniFormat); |
304 QString cc = settings.value("misc/locale", QString()).toString(); |
295 QString cc = settings.value("misc/locale", QString()).toString(); |