refs #452, adjusted aircraft/aviation classes

* support for loading from datastore
* improved timestamp handling
* new color and country classes
* new attributes
* updates for missing parts in CUser
This commit is contained in:
Klaus Basan
2015-09-23 03:20:36 +02:00
committed by Mathew Sutcliffe
parent c5f7179588
commit ae24700299
45 changed files with 2762 additions and 401 deletions

View File

@@ -23,11 +23,32 @@ namespace BlackMisc
CSequence<CLivery>(other)
{ }
CLiveryList CLiveryList::findByCombinedCode(const QString &combinedCode) const
CLiveryList CLiveryList::findByAirlineIcaoDesignator(const QString &icao) const
{
QString cc(combinedCode.trimmed().toUpper());
if (cc.isEmpty()) { return CLiveryList();}
return this->findBy(&CLivery::getCombinedCode, cc);
QString i(icao.trimmed().toUpper());
if (i.isEmpty()) { return CLiveryList(); }
return this->findBy(&CLivery::getAirlineIcaoCodeDesignator, i);
}
CLivery CLiveryList::findByAirlineIcaoDesignatorStdLivery(const QString &icao) const
{
QString i(icao.trimmed().toUpper());
if (i.isEmpty()) { return CLivery(); }
return this->findFirstByOrDefault([&](const CLivery & livery)
{
return livery.getAirlineIcaoCodeDesignator() == icao &&
livery.isAirlineStandardLivery();
});
}
CLivery CLiveryList::findByCombinedCode(const QString &combinedCode) const
{
if (!CLivery::isValidCombinedCode(combinedCode)) { return CLivery(); }
return this->findFirstByOrDefault([&](const CLivery & livery)
{
return livery.matchesCombinedCode(combinedCode);
});
}
} // namespace