NOISSUE remove unused 'test mode'

This commit is contained in:
Petr Mrázek 2016-10-28 21:54:12 +02:00
parent 8731318fef
commit b5aaf88f12
2 changed files with 18 additions and 31 deletions

View File

@ -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);

View File

@ -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();