mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
Ref T109, improved lookup and matching log message
This commit is contained in:
committed by
Mathew Sutcliffe
parent
dfb6b05e9d
commit
b53a02821b
@@ -22,6 +22,7 @@
|
||||
#include <QRegularExpression>
|
||||
#include <QRegularExpressionMatch>
|
||||
#include <QThreadStorage>
|
||||
#include <QStringBuilder>
|
||||
#include <Qt>
|
||||
#include <QtGlobal>
|
||||
|
||||
@@ -83,10 +84,8 @@ namespace BlackMisc
|
||||
QString CAircraftIcaoCode::convertToQString(bool i18n) const
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
QString s(this->m_designator);
|
||||
if (this->hasValidCombinedType()) { s.append(" ").append(this->m_combinedType); }
|
||||
if (this->hasValidWtc()) { s.append(" ").append(this->m_wtc); }
|
||||
return s;
|
||||
static const QString s("%1 %2 %3");
|
||||
return s.arg(this->getDesignatorDbKey(), this->getCombinedType(), this->getWtc());
|
||||
}
|
||||
|
||||
void CAircraftIcaoCode::updateMissingParts(const CAircraftIcaoCode &otherIcaoCode)
|
||||
@@ -371,20 +370,12 @@ namespace BlackMisc
|
||||
|
||||
void CAircraftIcaoCode::setRank(int rank)
|
||||
{
|
||||
if (rank < 0 || rank >= 10)
|
||||
{
|
||||
m_rank = 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_rank = rank;
|
||||
}
|
||||
m_rank = (rank < 0 || rank >= 10) ? 10 : rank;
|
||||
}
|
||||
|
||||
QString CAircraftIcaoCode::getCombinedIcaoStringWithKey() const
|
||||
{
|
||||
QString s(getDesignator());
|
||||
if (s.isEmpty()) s = "????";
|
||||
QString s(hasDesignator() ? getDesignator() : "????");
|
||||
if (hasManufacturer()) { s = s.append(" ").append(getManufacturer()); }
|
||||
if (hasModelDescription()) { s = s.append(" ").append(getModelDescription()); }
|
||||
return s.append(getDbKeyAsStringInParentheses(" "));
|
||||
|
||||
Reference in New Issue
Block a user