NOISSUE remove unused 'test mode'
This commit is contained in:
parent
8731318fef
commit
b5aaf88f12
@ -70,7 +70,7 @@
|
|||||||
|
|
||||||
using namespace Commandline;
|
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
|
#if defined Q_OS_WIN32
|
||||||
// attach the parent console
|
// 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.
|
// in test mode, root path is the same as the binary path.
|
||||||
if (test_mode)
|
|
||||||
{
|
|
||||||
rootPath = binPath;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
QDir foo(FS::PathCombine(binPath, ".."));
|
QDir foo(FS::PathCombine(binPath, ".."));
|
||||||
rootPath = foo.absolutePath();
|
rootPath = foo.absolutePath();
|
||||||
@ -206,7 +200,6 @@ MultiMC::MultiMC(int &argc, char **argv, bool test_mode) : QApplication(argc, ar
|
|||||||
QDir foo(FS::PathCombine(binPath, "../.."));
|
QDir foo(FS::PathCombine(binPath, "../.."));
|
||||||
rootPath = foo.absolutePath();
|
rootPath = foo.absolutePath();
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
// init the logger
|
// init the logger
|
||||||
initLogger();
|
initLogger();
|
||||||
@ -233,7 +226,7 @@ MultiMC::MultiMC(int &argc, char **argv, bool test_mode) : QApplication(argc, ar
|
|||||||
}
|
}
|
||||||
|
|
||||||
// load settings
|
// load settings
|
||||||
initGlobalSettings(test_mode);
|
initGlobalSettings();
|
||||||
|
|
||||||
// load translations
|
// load translations
|
||||||
initTranslations();
|
initTranslations();
|
||||||
@ -450,7 +443,7 @@ void MultiMC::initLogger()
|
|||||||
logFile->open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
|
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));
|
m_settings.reset(new INISettingsObject("multimc.cfg", this));
|
||||||
// Updates
|
// Updates
|
||||||
@ -477,25 +470,19 @@ void MultiMC::initGlobalSettings(bool test_mode)
|
|||||||
#else
|
#else
|
||||||
defaultMonospace = "Monospace";
|
defaultMonospace = "Monospace";
|
||||||
#endif
|
#endif
|
||||||
if(!test_mode)
|
|
||||||
{
|
// resolve the font so the default actually matches
|
||||||
// resolve the font so the default actually matches
|
QFont consoleFont;
|
||||||
QFont consoleFont;
|
consoleFont.setFamily(defaultMonospace);
|
||||||
consoleFont.setFamily(defaultMonospace);
|
consoleFont.setStyleHint(QFont::Monospace);
|
||||||
consoleFont.setStyleHint(QFont::Monospace);
|
consoleFont.setFixedPitch(true);
|
||||||
consoleFont.setFixedPitch(true);
|
QFontInfo consoleFontInfo(consoleFont);
|
||||||
QFontInfo consoleFontInfo(consoleFont);
|
QString resolvedDefaultMonospace = consoleFontInfo.family();
|
||||||
QString resolvedDefaultMonospace = consoleFontInfo.family();
|
QFont resolvedFont(resolvedDefaultMonospace);
|
||||||
QFont resolvedFont(resolvedDefaultMonospace);
|
qDebug() << "Detected default console font:" << resolvedDefaultMonospace
|
||||||
qDebug() << "Detected default console font:" << resolvedDefaultMonospace
|
<< ", substitutions:" << resolvedFont.substitutions().join(',');
|
||||||
<< ", substitutions:" << resolvedFont.substitutions().join(',');
|
|
||||||
m_settings->registerSetting("ConsoleFont", resolvedDefaultMonospace);
|
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);
|
|
||||||
}
|
|
||||||
m_settings->registerSetting("ConsoleFontSize", defaultSize);
|
m_settings->registerSetting("ConsoleFontSize", defaultSize);
|
||||||
m_settings->registerSetting("ConsoleMaxLines", 100000);
|
m_settings->registerSetting("ConsoleMaxLines", 100000);
|
||||||
m_settings->registerSetting("ConsoleOverflowStop", true);
|
m_settings->registerSetting("ConsoleOverflowStop", true);
|
||||||
|
@ -48,7 +48,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MultiMC(int &argc, char **argv, bool test_mode = false);
|
MultiMC(int &argc, char **argv);
|
||||||
virtual ~MultiMC();
|
virtual ~MultiMC();
|
||||||
|
|
||||||
// InstanceList, IconList, OneSixFTBInstance, LegacyUpdate, LegacyInstance, MCEditTool, JVisualVM, MinecraftInstance, JProfiler, BaseInstance
|
// InstanceList, IconList, OneSixFTBInstance, LegacyUpdate, LegacyInstance, MCEditTool, JVisualVM, MinecraftInstance, JProfiler, BaseInstance
|
||||||
@ -156,7 +156,7 @@ private:
|
|||||||
void initLogger();
|
void initLogger();
|
||||||
void initIcons();
|
void initIcons();
|
||||||
void initThemes();
|
void initThemes();
|
||||||
void initGlobalSettings(bool test_mode);
|
void initGlobalSettings();
|
||||||
void initTranslations();
|
void initTranslations();
|
||||||
void initSSL();
|
void initSSL();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user