mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
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:
committed by
Mathew Sutcliffe
parent
c5f7179588
commit
ae24700299
@@ -9,7 +9,10 @@
|
||||
|
||||
#include "blackmisc/datastoreobjectlist.h"
|
||||
#include "blackmisc/predicates.h"
|
||||
#include "blackmisc/countrylist.h"
|
||||
#include "blackmisc/aviation/liverylist.h"
|
||||
#include "blackmisc/aviation/aircrafticaocodelist.h"
|
||||
#include "blackmisc/aviation/airlineicaocodelist.h"
|
||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||
#include "blackmisc/simulation/distributorlist.h"
|
||||
#include <algorithm>
|
||||
@@ -26,7 +29,7 @@ namespace BlackMisc
|
||||
{ }
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
OBJ IDatastoreObjectListWithIntegerKey<OBJ, CONTAINER>::findByKey(int key, const OBJ ¬Found ) const
|
||||
OBJ IDatastoreObjectListWithIntegerKey<OBJ, CONTAINER>::findByKey(int key, const OBJ ¬Found) const
|
||||
{
|
||||
return this->container().findFirstByOrDefault(&OBJ::getDbKey, key, notFound);
|
||||
}
|
||||
@@ -49,6 +52,17 @@ namespace BlackMisc
|
||||
this->container().sort(BlackMisc::Predicates::MemberLess(&OBJ::getDbKey));
|
||||
}
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
QStringList IDatastoreObjectListWithStringKey<OBJ, CONTAINER>::toDbKeyList() const
|
||||
{
|
||||
QStringList keys;
|
||||
for (const OBJ &obj : ITimestampObjectList<OBJ, CONTAINER>::container())
|
||||
{
|
||||
keys.append(obj.getDbKey());
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
CONTAINER IDatastoreObjectListWithIntegerKey<OBJ, CONTAINER>::fromDatabaseJson(const QJsonArray &array)
|
||||
{
|
||||
@@ -74,7 +88,10 @@ namespace BlackMisc
|
||||
// see here for the reason of thess forward instantiations
|
||||
// http://www.parashift.com/c++-faq/separate-template-class-defn-from-decl.html
|
||||
template class IDatastoreObjectListWithIntegerKey<BlackMisc::Aviation::CLivery, BlackMisc::Aviation::CLiveryList>;
|
||||
template class IDatastoreObjectListWithIntegerKey<BlackMisc::Aviation::CAircraftIcaoCode, BlackMisc::Aviation::CAircraftIcaoCodeList>;
|
||||
template class IDatastoreObjectListWithIntegerKey<BlackMisc::Aviation::CAirlineIcaoCode, BlackMisc::Aviation::CAirlineIcaoCodeList>;
|
||||
template class IDatastoreObjectListWithIntegerKey<BlackMisc::Simulation::CAircraftModel, BlackMisc::Simulation::CAircraftModelList>;
|
||||
template class IDatastoreObjectListWithStringKey<BlackMisc::Simulation::CDistributor, BlackMisc::Simulation::CDistributorList>;
|
||||
template class IDatastoreObjectListWithStringKey<BlackMisc::CCountry, BlackMisc::CCountryList>;
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user