summaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-29 14:38:09 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-30 09:16:55 -0700
commit4cd7767bec39e236483ed560f44b8eb54dab76c9 (patch)
tree1ac040140d7fba953257e6b4e4408f6620d607a6 /qt-models
parentcbf1f35d63dd32e900e63aa70a276f9bc74b0a26 (diff)
downloadsubsurface-4cd7767bec39e236483ed560f44b8eb54dab76c9.tar.gz
message handler: make the log output less verbose
Skip truly identical / repetitive messages. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/messagehandlermodel.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/qt-models/messagehandlermodel.cpp b/qt-models/messagehandlermodel.cpp
index 6a5f9953d..4952758d2 100644
--- a/qt-models/messagehandlermodel.cpp
+++ b/qt-models/messagehandlermodel.cpp
@@ -39,6 +39,13 @@ int MessageHandlerModel::rowCount(const QModelIndex&) const
void MessageHandlerModel::addLog(QtMsgType type, const QString& message)
{
+ if (!m_data.isEmpty()) {
+ struct MessageData *lm = &m_data.last();
+ QString lastMessage = lm->message.mid(lm->message.indexOf(':'));
+ QString newMessage = message.mid(message.indexOf(':'));
+ if (lastMessage == newMessage)
+ return;
+ }
beginInsertRows(QModelIndex(), rowCount(), rowCount());
m_data.append({message, type});
endInsertRows();