diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-05-17 18:21:32 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-05-17 18:21:32 +0200 |
commit | 7f2a16917e347db2ffcdd5a148feda71f6f3a47e (patch) | |
tree | 12d7d1d7439497f7cdfee81ffe5d249e79255bff /MultiMC.cpp | |
parent | 8a8c4193e6ee7cd55870ef8495cb7cc3b9534e02 (diff) | |
download | MultiMC-7f2a16917e347db2ffcdd5a148feda71f6f3a47e.tar MultiMC-7f2a16917e347db2ffcdd5a148feda71f6f3a47e.tar.gz MultiMC-7f2a16917e347db2ffcdd5a148feda71f6f3a47e.tar.lz MultiMC-7f2a16917e347db2ffcdd5a148feda71f6f3a47e.tar.xz MultiMC-7f2a16917e347db2ffcdd5a148feda71f6f3a47e.zip |
Add static data path for ... static data. Like translations. Move translations there.
Diffstat (limited to 'MultiMC.cpp')
-rw-r--r-- | MultiMC.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/MultiMC.cpp b/MultiMC.cpp index a0ff8b66..41c81b7b 100644 --- a/MultiMC.cpp +++ b/MultiMC.cpp @@ -161,6 +161,17 @@ MultiMC::MultiMC(int &argc, char **argv, bool root_override) #endif } + // static data paths... mostly just for translations + #ifdef Q_OS_LINUX + QDir foo(PathCombine(binPath, "..")); + staticDataPath = foo.absolutePath(); + #elif defined(Q_OS_WIN32) + staticDataPath = binPath; + #elif defined(Q_OS_MAC) + QDir foo(PathCombine(rootPath, "Contents/Resources")); + staticDataPath = foo.absolutePath(); + #endif + // init the logger initLogger(); @@ -179,6 +190,7 @@ MultiMC::MultiMC(int &argc, char **argv, bool root_override) } QLOG_INFO() << "Binary path : " << binPath; QLOG_INFO() << "Application root path : " << rootPath; + QLOG_INFO() << "Static data path : " << staticDataPath; // load settings initGlobalSettings(); @@ -287,7 +299,8 @@ void MultiMC::initTranslations() } m_mmc_translator.reset(new QTranslator()); - if (m_mmc_translator->load("mmc_" + locale.bcp47Name(), MMC->root() + "/translations")) + if (m_mmc_translator->load("mmc_" + locale.bcp47Name(), + MMC->staticData() + "/translations")) { QLOG_DEBUG() << "Loading MMC Language File for" << locale.bcp47Name().toLocal8Bit().constData() << "..."; |