From 2f095a04ed69d9aa14b47dc4acde6b3225b2d65e Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Mon, 24 May 2021 21:55:29 +0200 Subject: New upstream version 2.4.0+repack --- widgets/displaytext.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'widgets/displaytext.cpp') diff --git a/widgets/displaytext.cpp b/widgets/displaytext.cpp index 2d916efd..33a6a4e3 100644 --- a/widgets/displaytext.cpp +++ b/widgets/displaytext.cpp @@ -413,17 +413,19 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con else { if (bCQonly) return; - if (myCall != "" && (decodedText.indexOf (" " + myCall + " ") >= 0 - or decodedText.indexOf (" " + myCall + "/") >= 0 - or decodedText.indexOf ("<" + myCall + "/") >= 0 - or decodedText.indexOf ("/" + myCall + " ") >= 0 - or decodedText.indexOf ("/" + myCall + ">") >= 0 - or decodedText.indexOf ("<" + myCall + " ") >= 0 - or decodedText.indexOf ("<" + myCall + ">") >= 0 - or decodedText.indexOf (" " + myCall + ">") >= 0)) { - highlight_types types {Highlight::MyCall}; - set_colours (m_config, &bg, &fg, types); - } + 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; -- cgit v1.2.3