mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
message handler: make the log output less verbose
Skip truly identical / repetitive messages. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
cbf1f35d63
commit
4cd7767bec
1 changed files with 7 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue