From b5aaf88f12118eae9997abf70cbeea612fea4b51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Fri, 28 Oct 2016 21:54:12 +0200 Subject: NOISSUE remove unused 'test mode' --- application/MultiMC.cpp | 45 ++++++++++++++++----------------------------- application/MultiMC.h | 4 ++-- 2 files changed, 18 insertions(+), 31 deletions(-) (limited to 'application') 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(); -- cgit v1.2.3