# HG changeset patch
# User unc0rr
# Date 1352058987 -14400
# Node ID 5a27ed7f17b7c2e1342fe3324b482eacbea24617
# Parent  88fde28bbda6c1234cd6e3236cda9978dd51ddd7
Wee, now frontend is able to load translation file

diff -r 88fde28bbda6 -r 5a27ed7f17b7 QTfrontend/main.cpp
--- a/QTfrontend/main.cpp	Sat Nov 03 00:34:35 2012 +0400
+++ b/QTfrontend/main.cpp	Sun Nov 04 23:56:27 2012 +0400
@@ -221,8 +221,10 @@
         return 1;
     }
 
+    // setup PhysFS
     engine.mount(datadir->absolutePath());
     engine.mount(cfgdir->absolutePath() + "/Data");
+    engine.mount(cfgdir->absolutePath());
     engine.setWriteDir(cfgdir->absolutePath());
 
     DataManager & dataMgr = DataManager::instance();
@@ -235,11 +237,8 @@
             cc = QLocale::system().name();
 
         // load locale file into translator
-        Translator.load(
-            dataMgr.findFileForRead(
-                QString("physfs://Locale/hedgewars_" + cc)
-            )
-        );
+        if(!Translator.load(QString("physfs://Locale/hedgewars_%1").arg(cc)))
+            qWarning("Failed to install translation");
         app.installTranslator(&Translator);
     }
 
diff -r 88fde28bbda6 -r 5a27ed7f17b7 QTfrontend/util/FileEngine.cpp
--- a/QTfrontend/util/FileEngine.cpp	Sat Nov 03 00:34:35 2012 +0400
+++ b/QTfrontend/util/FileEngine.cpp	Sun Nov 04 23:56:27 2012 +0400
@@ -167,10 +167,12 @@
         _filename = file.mid(FileEngineHandler::scheme.size());
     else
         _filename = file;
+
     PHYSFS_Stat stat;
     if (PHYSFS_stat(_filename.toUtf8().constData(), &stat) != 0) {
         _size = stat.filesize;
         _datetime = QDateTime::fromTime_t(stat.modtime);
+        _flags |= QAbstractFileEngine::ReadUserPerm;
         _flags |= QAbstractFileEngine::ExistsFlag;
 
         switch (stat.filetype)