diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-02-08 20:01:42 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-02-08 20:01:42 +0100 |
commit | 8bbaab334c5116be4c180c3eac93c4acc844f4bd (patch) | |
tree | ddb2796f0cfe574bec2132e98eff675d2ccccb59 /api/logic/BaseInstance.cpp | |
parent | 155de307bc6ef1a42226831550680110e00dc8c3 (diff) | |
download | MultiMC-8bbaab334c5116be4c180c3eac93c4acc844f4bd.tar MultiMC-8bbaab334c5116be4c180c3eac93c4acc844f4bd.tar.gz MultiMC-8bbaab334c5116be4c180c3eac93c4acc844f4bd.tar.lz MultiMC-8bbaab334c5116be4c180c3eac93c4acc844f4bd.tar.xz MultiMC-8bbaab334c5116be4c180c3eac93c4acc844f4bd.zip |
NOISSUE set line limit and overflow behaviour even for hidden console
Diffstat (limited to 'api/logic/BaseInstance.cpp')
-rw-r--r-- | api/logic/BaseInstance.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/api/logic/BaseInstance.cpp b/api/logic/BaseInstance.cpp index 335ef392..6d719c32 100644 --- a/api/logic/BaseInstance.cpp +++ b/api/logic/BaseInstance.cpp @@ -51,6 +51,9 @@ BaseInstance::BaseInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr s m_settings->registerOverride(globalSettings->getSetting("AutoCloseConsole"), consoleSetting); m_settings->registerOverride(globalSettings->getSetting("ShowConsoleOnError"), consoleSetting); m_settings->registerOverride(globalSettings->getSetting("LogPrePostOutput"), consoleSetting); + + m_settings->registerPassthrough(globalSettings->getSetting("ConsoleMaxLines"), nullptr); + m_settings->registerPassthrough(globalSettings->getSetting("ConsoleOverflowStop"), nullptr); } QString BaseInstance::getPreLaunchCommand() @@ -68,6 +71,24 @@ QString BaseInstance::getPostExitCommand() return settings()->get("PostExitCommand").toString(); } +int BaseInstance::getConsoleMaxLines() const +{ + auto lineSetting = settings()->getSetting("ConsoleMaxLines"); + bool conversionOk = false; + int maxLines = lineSetting->get().toInt(&conversionOk); + if(!conversionOk) + { + maxLines = lineSetting->defValue().toInt(); + qWarning() << "ConsoleMaxLines has nonsensical value, defaulting to" << maxLines; + } + return maxLines; +} + +bool BaseInstance::shouldStopOnConsoleOverflow() const +{ + return settings()->get("ConsoleOverflowStop").toBool(); +} + void BaseInstance::iconUpdated(QString key) { if(iconKey() == key) |