mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-09 21:45:34 +08:00
refs #634, improved completers
* mostly to avoid roundtrips (set->changed signal->set again...) * better sort for ICAO completer
This commit is contained in:
@@ -13,7 +13,6 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
{
|
||||
|
||||
CAircraftIcaoCodeList::CAircraftIcaoCodeList(const CSequence<CAircraftIcaoCode> &other) :
|
||||
CSequence<CAircraftIcaoCode>(other)
|
||||
{ }
|
||||
@@ -81,6 +80,24 @@ namespace BlackMisc
|
||||
});
|
||||
}
|
||||
|
||||
CAircraftIcaoCodeList CAircraftIcaoCodeList::findWithIataCode(bool removeWhenSameAsDesignator) const
|
||||
{
|
||||
return this->findBy([&](const CAircraftIcaoCode & code)
|
||||
{
|
||||
if (!code.hasIataCode()) { return false; }
|
||||
return !removeWhenSameAsDesignator || !code.isIataSameAsDesignator();
|
||||
});
|
||||
}
|
||||
|
||||
CAircraftIcaoCodeList CAircraftIcaoCodeList::findWithFamily(bool removeWhenSameAsDesignator) const
|
||||
{
|
||||
return this->findBy([&](const CAircraftIcaoCode & code)
|
||||
{
|
||||
if (!code.hasFamily()) { return false; }
|
||||
return !removeWhenSameAsDesignator || !code.isFamilySameAsDesignator();
|
||||
});
|
||||
}
|
||||
|
||||
CAircraftIcaoCode CAircraftIcaoCodeList::findFirstByDesignatorAndRank(const QString &designator) const
|
||||
{
|
||||
if (!CAircraftIcaoCode::isValidDesignator(designator)) { return CAircraftIcaoCode(); }
|
||||
|
||||
Reference in New Issue
Block a user