summaryrefslogtreecommitdiff
path: root/widgets/displaytext.cpp
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2021-05-24 21:55:29 +0200
committerChristoph Berg <myon@debian.org>2021-05-24 21:55:29 +0200
commit2f095a04ed69d9aa14b47dc4acde6b3225b2d65e (patch)
treefe929dd7dbe483f5f439c7a7935125e871550296 /widgets/displaytext.cpp
parent5c88480ddc5c5dab1f3444a8b8de9303fd6140da (diff)
New upstream version 2.4.0+repackupstream/2.4.0+repack
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;