diff options
Diffstat (limited to 'api/logic')
-rw-r--r-- | api/logic/launch/LogModel.cpp | 9 | ||||
-rw-r--r-- | api/logic/launch/LogModel.h | 2 |
2 files changed, 11 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(); diff --git a/api/logic/launch/LogModel.h b/api/logic/launch/LogModel.h index 87e6b583..558242d8 100644 --- a/api/logic/launch/LogModel.h +++ b/api/logic/launch/LogModel.h @@ -17,6 +17,7 @@ public: void append(MessageLevel::Enum, QString line); void clear(); + void suspend(bool suspend); QString toPlainText(); @@ -45,6 +46,7 @@ private: /* data */ int m_numLines = 0; bool m_stopOnOverflow = false; QString m_overflowMessage = "OVERFLOW"; + bool m_suspended = false; private: Q_DISABLE_COPY(LogModel) |