Skip to content

Commit

Permalink
Qt/LogWidget: Don't show duplicate entries
Browse files Browse the repository at this point in the history
  • Loading branch information
spycrab committed Feb 18, 2019
1 parent 286aafd commit c09fba3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Source/Core/DolphinQt/Config/LogWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ void LogWidget::Log(LogTypes::LOG_LEVELS level, const char* text)
QueueOnObject(this, [this, level, str]() mutable {
std::lock_guard<std::mutex> lock(m_log_mutex);

static std::string last = "";

if (last == str)
return;

const char* color = "white";

switch (level)
Expand Down Expand Up @@ -222,6 +227,8 @@ void LogWidget::Log(LogTypes::LOG_LEVELS level, const char* text)
.arg(QString::fromStdString(str.substr(0, TIMESTAMP_LENGTH)),
QString::fromStdString(color),
QString::fromStdString(str.substr(TIMESTAMP_LENGTH)).toHtmlEscaped()));

last = str;
});
}

Expand Down

0 comments on commit c09fba3

Please sign in to comment.