diff options
| author | Christoph Berg <myon@debian.org> | 2021-05-24 21:56:12 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2021-05-24 21:56:12 +0200 |
| commit | 5d6ce68ef66fcb9fa736d942b757f6b039684a8e (patch) | |
| tree | ac5434b0bb2c1610af8fd22a3d50bee3d2047cd8 /widgets/displaytext.cpp | |
| parent | f31b3d26dc737dcc9d2e9b8ea34690ffc669815c (diff) | |
| parent | 2f095a04ed69d9aa14b47dc4acde6b3225b2d65e (diff) | |
Update upstream source from tag 'upstream/2.4.0+repack'
Update to upstream version '2.4.0+repack'
with Debian dir 9ca745702cabe41ba6c3b1e36a86b074ebd5a230
Diffstat (limited to 'widgets/displaytext.cpp')
| -rw-r--r-- | widgets/displaytext.cpp | 24 |
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; |
