From 4e7aa94b3258348ebaa15e00c8be1e7e31e33599 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sat, 11 Nov 2023 12:41:21 +0100 Subject: [PATCH] Gui: ReportView - include notifier string ========================================= Console error, warnings, ... allow for a notifiername. This appears separately in the notification area. However, the report view ignores it. This commit prepends the notifier string separated by a semicolon, if not empty. It solves the problem that, if the message did not include the notifier, this was not indicated in the Report View. If the message included the notifier, then it was duplicated in the notification area. --- src/Gui/ReportView.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Gui/ReportView.cpp b/src/Gui/ReportView.cpp index 4556178851..6749855f81 100644 --- a/src/Gui/ReportView.cpp +++ b/src/Gui/ReportView.cpp @@ -469,8 +469,6 @@ void ReportOutput::restoreFont() void ReportOutput::SendLog(const std::string& notifiername, const std::string& msg, Base::LogStyle level, Base::IntendedRecipient recipient, Base::ContentType content) { - (void) notifiername; - // Do not log translated messages, or messages intended only to the user to the Report View if( recipient == Base::IntendedRecipient::User || content == Base::ContentType::Translated) @@ -497,7 +495,15 @@ void ReportOutput::SendLog(const std::string& notifiername, const std::string& m break; } - QString qMsg = QString::fromUtf8(msg.c_str()); + QString qMsg; + + if(!notifiername.empty()) { + qMsg = QStringLiteral("%1: %2").arg(QString::fromUtf8(notifiername.c_str()), + QString::fromUtf8(msg.c_str())); + } + else { + qMsg = QString::fromUtf8(msg.c_str()); + } // This truncates log messages that are too long if (style == ReportHighlighter::LogText) {