From: konrad Date: Sat, 6 Sep 2008 13:22:03 +0000 (+0000) Subject: look for translation in correct path X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=96a2fd713609419e3330749b87ed5e37aa7b53e5;p=web%2Fkonrad%2Fsmoke.git look for translation in correct path git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@173 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- diff --git a/src/debug.cpp b/src/debug.cpp index 102b672..a0d0098 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -34,7 +34,7 @@ static void mymsghandler(QtMsgType, const char *msg) void initDebug() { - QDir(dataDir).mkdir("debuglog"); + QDir(dataDir).mkpath("debuglog"); mylogFile=new QFile(dataDir+"/debuglog/log-"+QDateTime::currentDateTime().toString("yyyy-MM-dd_hh.mm.ss.zzz")+".txt"); if(mylogFile->open(QIODevice::WriteOnly|QIODevice::Append|QIODevice::Text)){ qInstallMsgHandler(mymsghandler); @@ -44,4 +44,4 @@ void initDebug() qDebug("Failed to install debuglog."); } -} \ No newline at end of file +} diff --git a/src/main.cpp b/src/main.cpp index bc95b08..83894a7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -99,10 +99,12 @@ int main(int argc,char**argv) } qDebug("Loading language %s",lang.toAscii().data()); QTranslator qttrans; - qttrans.load("qt_"+lang); + bool ok=qttrans.load("qt_"+lang,QApplication::applicationDirPath()); + qDebug("...loading qt_%s ...%s",lang.toAscii().data(),ok?"ok":"failed"); app.installTranslator(&qttrans); QTranslator mstrans; - mstrans.load("smoke_"+lang); + ok=mstrans.load("smoke_"+lang,QApplication::applicationDirPath()); + qDebug("...loading smoke_%s ...%s",lang.toAscii().data(),ok?"ok":"failed"); app.installTranslator(&mstrans); //try to find data dir