mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
Completer sort order and ICAO code string building
This commit is contained in:
@@ -468,32 +468,30 @@ namespace BlackMisc
|
||||
|
||||
QString CAircraftIcaoCode::getCombinedIcaoStringWithKey() const
|
||||
{
|
||||
QString s(hasDesignator() ? getDesignator() : "????");
|
||||
if (hasManufacturer()) { s = s.append(" ").append(getManufacturer()); }
|
||||
if (hasModelDescription()) { s = s.append(" ").append(getModelDescription()); }
|
||||
return s.append(getDbKeyAsStringInParentheses(" "));
|
||||
return (this->hasDesignator() ? this->getDesignator() : QStringLiteral("????")) %
|
||||
(this->hasManufacturer() ? (QStringLiteral(" ") % this->getManufacturer()) : QStringLiteral("")) %
|
||||
(this->hasModelDescription() ? (QStringLiteral(" ") % this->getModelDescription()) : QStringLiteral("")) %
|
||||
this->getDbKeyAsStringInParentheses(" ");
|
||||
}
|
||||
|
||||
QString CAircraftIcaoCode::getCombinedIataStringWithKey() const
|
||||
{
|
||||
if (!this->hasIataCode()) { return ""; }
|
||||
QString s(getIataCode());
|
||||
s = s.append(" [IATA]");
|
||||
if (hasDesignator()) { s.append(" ").append(getDesignator()); }
|
||||
if (hasManufacturer()) { s = s.append(" ").append(getManufacturer()); }
|
||||
if (hasModelDescription()) { s = s.append(" ").append(getModelDescription()); }
|
||||
return s.append(getDbKeyAsStringInParentheses(" "));
|
||||
return this->getIataCode() % QStringLiteral(" [IATA") %
|
||||
(this->hasDesignator() ? (QStringLiteral(" ") % this->getDesignator()) : QStringLiteral("")) %
|
||||
(this->hasManufacturer() ? (QStringLiteral(" ") % this->getManufacturer()) : QStringLiteral("")) %
|
||||
(this->hasModelDescription() ? (QStringLiteral(" ") % this->getModelDescription()) : QStringLiteral("")) %
|
||||
this->getDbKeyAsStringInParentheses(" ");
|
||||
}
|
||||
|
||||
QString CAircraftIcaoCode::getCombinedFamilyStringWithKey() const
|
||||
{
|
||||
if (!this->hasFamily()) { return ""; }
|
||||
QString s(getFamily());
|
||||
s = s.append(" [family]");
|
||||
if (hasDesignator()) { s.append(" ").append(getDesignator()); }
|
||||
if (hasManufacturer()) { s.append(" ").append(getManufacturer()); }
|
||||
if (hasModelDescription()) { s.append(" ").append(getModelDescription()); }
|
||||
return s.append(getDbKeyAsStringInParentheses(" "));
|
||||
return this->getFamily() % QStringLiteral(" [family") %
|
||||
(this->hasDesignator() ? (QStringLiteral(" ") % this->getDesignator()) : QStringLiteral("")) %
|
||||
(this->hasManufacturer() ? (QStringLiteral(" ") % this->getManufacturer()) : QStringLiteral("")) %
|
||||
(this->hasModelDescription() ? (QStringLiteral(" ") % this->getModelDescription()) : QStringLiteral("")) %
|
||||
this->getDbKeyAsStringInParentheses(" ");
|
||||
}
|
||||
|
||||
bool CAircraftIcaoCode::hasCompleteData() const
|
||||
|
||||
@@ -222,7 +222,7 @@ namespace BlackMisc
|
||||
CAircraftIcaoCodeList icaos(*this);
|
||||
if (sort) { icaos.sortByDesignatorAndRank(); }
|
||||
|
||||
// 3 steps to get a proper sort order
|
||||
// 3 steps to get a proper sort order of the string list
|
||||
for (const CAircraftIcaoCode &icao : as_const(icaos))
|
||||
{
|
||||
c.append(icao.getCombinedIcaoStringWithKey());
|
||||
@@ -230,8 +230,8 @@ namespace BlackMisc
|
||||
|
||||
if (withFamily)
|
||||
{
|
||||
icaos = this->findWithFamily(true);
|
||||
for (const CAircraftIcaoCode &icao : as_const(icaos))
|
||||
const CAircraftIcaoCodeList icaosFamily = icaos.findWithFamily(true);
|
||||
for (const CAircraftIcaoCode &icao : icaosFamily)
|
||||
{
|
||||
c.append(icao.getCombinedFamilyStringWithKey());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user