Ref T111, ignore incomplete SELCAL codes (and do not use ASSERT)

This commit is contained in:
Klaus Basan
2017-08-08 02:34:55 +02:00
committed by Mathew Sutcliffe
parent ea6cf20587
commit d583808a4a

View File

@@ -67,10 +67,9 @@ namespace BlackGui
void CSelcalCodeSelector::setSelcalCode(const QString &selcal)
{
if (selcal.length() == 4 && this->getSelcalCode() == selcal) return; // avoid unintended signals
const QString s = selcal.isEmpty() ? " " : selcal.toUpper().trimmed();
Q_ASSERT(s.length() == 4);
if (s.length() != 4) return;
if (s.length() != 4) { return; } // still incomplete code
if (this->getSelcalCode() == s) { return; } // avoid unintended signals
const QString s1 = s.left(2);
const QString s2 = s.right(2);
if (BlackMisc::Aviation::CSelcal::codePairs().contains(s1))