From 5c09e55351c9efdb198f77afbe3f38a24237294e Mon Sep 17 00:00:00 2001 From: Uwe Risse Date: Fri, 21 Jan 2022 16:49:03 +0100 Subject: [PATCH] Correct highlighting of messages with myCall and 73 --- widgets/displaytext.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/widgets/displaytext.cpp b/widgets/displaytext.cpp index d588573a9..c3e31f83c 100644 --- a/widgets/displaytext.cpp +++ b/widgets/displaytext.cpp @@ -414,19 +414,6 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con else { if (bCQonly) return; - if (myCall.size ()) - { - QString regexp {"[ <]" + myCall + "[ >]"}; - if (Radio::is_compound_callsign (myCall)) - { - regexp = "(?:" + regexp + "|[ <]" + Radio::base_callsign (myCall) + "[ >])"; - } - if ((decodedText.clean_string () + " ").contains (QRegularExpression {regexp})) - { - highlight_types types {Highlight::MyCall}; - set_colours (m_config, &bg, &fg, types); - } - } } auto message = decodedText.string(); QString dxCall; @@ -473,6 +460,20 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con message = leftJustifyAppendage (message, extra); } + if (myCall.size ()) + { + QString regexp {"[ <]" + myCall + "[ >]"}; + if (Radio::is_compound_callsign (myCall)) + { + regexp = "(?:" + regexp + "|[ <]" + Radio::base_callsign (myCall) + "[ >])"; + } + if ((decodedText.clean_string () + " ").contains (QRegularExpression {regexp})) + { + highlight_types types {Highlight::MyCall}; + set_colours (m_config, &bg, &fg, types); + } + } + appendText (message.trimmed (), bg, fg, decodedText.call (), dxCall); }