refs #614, formatting and new functions for list/value objects

* find by aircraft family
* name completer sorting
This commit is contained in:
Klaus Basan
2016-04-04 12:45:05 +02:00
parent 4b621bcb1a
commit a07af2b781
11 changed files with 186 additions and 24 deletions

View File

@@ -149,6 +149,31 @@ namespace BlackMisc
return c;
}
bool CAircraftIcaoCode::matchesCombinedCode(const QString &combinedCode) const
{
const QString cc(combinedCode.toUpper().trimmed().replace(' ', '*').replace('-', '*'));
if (combinedCode.length() != 3) { return false; }
if (cc == this->getCombinedType()) { return true; }
const bool wildcard = cc.contains('*');
if (!wildcard) { return false; }
QChar at = cc.at(0);
QChar c = cc.at(1);
QChar et = cc.at(2);
if (at != '*')
{
const QString cat = getAircraftType();
if (cat.isEmpty() || cat.at(0) != at) { return false; }
}
if (c != '*')
{
if (getEngineCount() != c.digitValue()) { return false; }
}
if (et == '*') { return true; }
const QString cet = getEngineType();
return cet.length() == 1 && cet.at(0) == et;
}
QString CAircraftIcaoCode::getDesignatorManufacturer() const
{
QString d(getDesignator());