NOISSUE set line limit and overflow behaviour even for hidden console

This commit is contained in:
Petr Mrázek
2017-02-08 20:01:42 +01:00
parent 155de307bc
commit 8bbaab334c
7 changed files with 40 additions and 14 deletions

View File

@ -209,6 +209,12 @@ shared_qobject_ptr<LogModel> LaunchTask::getLogModel()
if(!m_logModel)
{
m_logModel.reset(new LogModel());
m_logModel->setMaxLines(m_instance->getConsoleMaxLines());
m_logModel->setStopOnOverflow(m_instance->shouldStopOnConsoleOverflow());
// FIXME: should this really be here?
m_logModel->setOverflowMessage(tr("MultiMC stopped watching the game log because the log length surpassed %1 lines.\n"
"You may have to fix your mods because the game is still logging to files and"
" likely wasting harddrive space at an alarming rate!").arg(m_logModel->getMaxLines()));
}
return m_logModel;
}

View File

@ -133,6 +133,11 @@ void LogModel::setMaxLines(int maxLines)
m_maxLines = maxLines;
}
int LogModel::getMaxLines()
{
return m_maxLines;
}
void LogModel::setStopOnOverflow(bool stop)
{
m_stopOnOverflow = stop;

View File

@ -21,6 +21,7 @@ public:
QString toPlainText();
int getMaxLines();
void setMaxLines(int maxLines);
void setStopOnOverflow(bool stop);
void setOverflowMessage(const QString & overflowMessage);