summaryrefslogtreecommitdiff
path: root/widgets/displaytext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/displaytext.cpp')
-rw-r--r--widgets/displaytext.cpp24
1 files changed, 13 insertions, 11 deletions
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;