summaryrefslogtreecommitdiffstats
path: root/api/logic/launch/LogModel.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-10-11 21:34:02 +0200
committerPetr Mrázek <peterix@gmail.com>2016-10-11 21:34:02 +0200
commitf07496ac6d42986266f3bff5093fa0009521ecd5 (patch)
treea1310562baf6bed178dc98e17c5e6fc824300176 /api/logic/launch/LogModel.cpp
parent6e80f03409054293bdbbcd0ce87b607a811016d5 (diff)
downloadMultiMC-f07496ac6d42986266f3bff5093fa0009521ecd5.tar
MultiMC-f07496ac6d42986266f3bff5093fa0009521ecd5.tar.gz
MultiMC-f07496ac6d42986266f3bff5093fa0009521ecd5.tar.lz
MultiMC-f07496ac6d42986266f3bff5093fa0009521ecd5.tar.xz
MultiMC-f07496ac6d42986266f3bff5093fa0009521ecd5.zip
GH-1675 reimplement suspesion of log watch
Diffstat (limited to 'api/logic/launch/LogModel.cpp')
-rw-r--r--api/logic/launch/LogModel.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/api/logic/launch/LogModel.cpp b/api/logic/launch/LogModel.cpp
index c12a0488..869c00f9 100644
--- a/api/logic/launch/LogModel.cpp
+++ b/api/logic/launch/LogModel.cpp
@@ -34,6 +34,10 @@ QVariant LogModel::data(const QModelIndex &index, int role) const
void LogModel::append(MessageLevel::Enum level, QString line)
{
+ if(m_suspended)
+ {
+ return;
+ }
int lineNum = (m_firstLine + m_numLines) % m_maxLines;
// overflow
if(m_numLines == m_maxLines)
@@ -60,6 +64,11 @@ void LogModel::append(MessageLevel::Enum level, QString line)
endInsertRows();
}
+void LogModel::suspend(bool suspend)
+{
+ m_suspended = suspend;
+}
+
void LogModel::clear()
{
beginResetModel();