diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-10-28 21:54:12 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-10-28 21:54:12 +0200 |
commit | b5aaf88f12118eae9997abf70cbeea612fea4b51 (patch) | |
tree | 3f51453a74955ee8d2c0d337490c8ee36e4e8561 | |
parent | 8731318fefad35acb8a2df408ef809dead1c7c07 (diff) | |
download | MultiMC-b5aaf88f12118eae9997abf70cbeea612fea4b51.tar MultiMC-b5aaf88f12118eae9997abf70cbeea612fea4b51.tar.gz MultiMC-b5aaf88f12118eae9997abf70cbeea612fea4b51.tar.lz MultiMC-b5aaf88f12118eae9997abf70cbeea612fea4b51.tar.xz MultiMC-b5aaf88f12118eae9997abf70cbeea612fea4b51.zip |
NOISSUE remove unused 'test mode'
-rw-r--r-- | application/MultiMC.cpp | 45 | ||||
-rw-r--r-- | application/MultiMC.h | 4 |
2 files changed, 18 insertions, 31 deletions
diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp index a226f3b7..f4c5318f 100644 --- a/application/MultiMC.cpp +++ b/application/MultiMC.cpp @@ -70,7 +70,7 @@ using namespace Commandline; -MultiMC::MultiMC(int &argc, char **argv, bool test_mode) : QApplication(argc, argv) +MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv) { #if defined Q_OS_WIN32 // attach the parent console @@ -191,12 +191,6 @@ MultiMC::MultiMC(int &argc, char **argv, bool test_mode) : QApplication(argc, ar } // in test mode, root path is the same as the binary path. - if (test_mode) - { - rootPath = binPath; - } - else - { #ifdef Q_OS_LINUX QDir foo(FS::PathCombine(binPath, "..")); rootPath = foo.absolutePath(); @@ -206,7 +200,6 @@ MultiMC::MultiMC(int &argc, char **argv, bool test_mode) : QApplication(argc, ar QDir foo(FS::PathCombine(binPath, "../..")); rootPath = foo.absolutePath(); #endif - } // init the logger initLogger(); @@ -233,7 +226,7 @@ MultiMC::MultiMC(int &argc, char **argv, bool test_mode) : QApplication(argc, ar } // load settings - initGlobalSettings(test_mode); + initGlobalSettings(); // load translations initTranslations(); @@ -450,7 +443,7 @@ void MultiMC::initLogger() logFile->open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate); } -void MultiMC::initGlobalSettings(bool test_mode) +void MultiMC::initGlobalSettings() { m_settings.reset(new INISettingsObject("multimc.cfg", this)); // Updates @@ -477,25 +470,19 @@ void MultiMC::initGlobalSettings(bool test_mode) #else defaultMonospace = "Monospace"; #endif - if(!test_mode) - { - // resolve the font so the default actually matches - QFont consoleFont; - consoleFont.setFamily(defaultMonospace); - consoleFont.setStyleHint(QFont::Monospace); - consoleFont.setFixedPitch(true); - QFontInfo consoleFontInfo(consoleFont); - QString resolvedDefaultMonospace = consoleFontInfo.family(); - QFont resolvedFont(resolvedDefaultMonospace); - qDebug() << "Detected default console font:" << resolvedDefaultMonospace - << ", substitutions:" << resolvedFont.substitutions().join(','); - m_settings->registerSetting("ConsoleFont", resolvedDefaultMonospace); - } - else - { - // in test mode, we don't have UI, so we don't do any font resolving - m_settings->registerSetting("ConsoleFont", defaultMonospace); - } + + // resolve the font so the default actually matches + QFont consoleFont; + consoleFont.setFamily(defaultMonospace); + consoleFont.setStyleHint(QFont::Monospace); + consoleFont.setFixedPitch(true); + QFontInfo consoleFontInfo(consoleFont); + QString resolvedDefaultMonospace = consoleFontInfo.family(); + QFont resolvedFont(resolvedDefaultMonospace); + qDebug() << "Detected default console font:" << resolvedDefaultMonospace + << ", substitutions:" << resolvedFont.substitutions().join(','); + + m_settings->registerSetting("ConsoleFont", resolvedDefaultMonospace); m_settings->registerSetting("ConsoleFontSize", defaultSize); m_settings->registerSetting("ConsoleMaxLines", 100000); m_settings->registerSetting("ConsoleOverflowStop", true); diff --git a/application/MultiMC.h b/application/MultiMC.h index 02038578..06819d28 100644 --- a/application/MultiMC.h +++ b/application/MultiMC.h @@ -48,7 +48,7 @@ public: }; public: - MultiMC(int &argc, char **argv, bool test_mode = false); + MultiMC(int &argc, char **argv); virtual ~MultiMC(); // InstanceList, IconList, OneSixFTBInstance, LegacyUpdate, LegacyInstance, MCEditTool, JVisualVM, MinecraftInstance, JProfiler, BaseInstance @@ -156,7 +156,7 @@ private: void initLogger(); void initIcons(); void initThemes(); - void initGlobalSettings(bool test_mode); + void initGlobalSettings(); void initTranslations(); void initSSL(); |