mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 08:45:36 +08:00
refs #720, adjusted exposed functions to new naming
* some minor formatting * use the new condolidation functions
This commit is contained in:
committed by
Mathew Sutcliffe
parent
d9a35563e3
commit
1167735897
@@ -39,7 +39,7 @@ namespace BlackCore
|
||||
CDatabaseReader::CDatabaseReader(QObject *owner, const CDatabaseReaderConfigList &config, const QString &name) :
|
||||
BlackCore::CThreadedReader(owner, name), m_config(config)
|
||||
{
|
||||
getDbUrl(); // init
|
||||
getDbUrl(); // init the cache
|
||||
}
|
||||
|
||||
void CDatabaseReader::readInBackgroundThread(CEntityFlags::Entity entities, const QDateTime &newerThan)
|
||||
@@ -314,7 +314,8 @@ namespace BlackCore
|
||||
|
||||
bool CDatabaseReader::canPingSwiftServer()
|
||||
{
|
||||
return CNetworkUtils::canConnect(getDbUrl());
|
||||
const CUrl url(getDbUrl());
|
||||
return CNetworkUtils::canConnect(url);
|
||||
}
|
||||
|
||||
void CDatabaseReader::JsonDatastoreResponse::setJsonArray(const QJsonArray &value)
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace BlackCore
|
||||
return;
|
||||
}
|
||||
|
||||
// get all or incremental set of distributor
|
||||
// get all or incremental set
|
||||
CDbInfoList infoObjects = CDbInfoList::fromDatabaseJson(res.getJsonArray());
|
||||
|
||||
// this part needs to be synchronized
|
||||
|
||||
@@ -57,11 +57,11 @@ namespace BlackCore
|
||||
return liveries.findByCombinedCode(combinedCode);
|
||||
}
|
||||
|
||||
CLivery CModelDataReader::getStdLiveryForAirlineCode(const CAirlineIcaoCode &icao) const
|
||||
CLivery CModelDataReader::getStdLiveryForAirlineVDesignator(const CAirlineIcaoCode &icao) const
|
||||
{
|
||||
if (!icao.hasValidDesignator()) { return CLivery(); }
|
||||
const CLiveryList liveries(getLiveries());
|
||||
return liveries.findStdLiveryByAirlineIcaoDesignator(icao);
|
||||
return liveries.findStdLiveryByAirlineIcaoVDesignator(icao);
|
||||
}
|
||||
|
||||
CLivery CModelDataReader::getLiveryForDbKey(int id) const
|
||||
@@ -117,6 +117,12 @@ namespace BlackCore
|
||||
return distributors.smartDistributorSelector(distributorPattern);
|
||||
}
|
||||
|
||||
CDistributor CModelDataReader::smartDistributorSelector(const CDistributor &distributorPattern, const CAircraftModel &model) const
|
||||
{
|
||||
const CDistributorList distributors(getDistributors()); // thread safe copy
|
||||
return distributors.smartDistributorSelector(distributorPattern, model);
|
||||
}
|
||||
|
||||
int CModelDataReader::getModelsCount() const
|
||||
{
|
||||
return this->getModels().size();
|
||||
@@ -127,9 +133,9 @@ namespace BlackCore
|
||||
return this->getModels().toDbKeyList();
|
||||
}
|
||||
|
||||
QStringList CModelDataReader::getModelStrings() const
|
||||
QStringList CModelDataReader::getModelStringList() const
|
||||
{
|
||||
return this->getModels().getModelStrings(false);
|
||||
return this->getModels().getModelStringList(false);
|
||||
}
|
||||
|
||||
bool CModelDataReader::areAllDataRead() const
|
||||
@@ -298,7 +304,7 @@ namespace BlackCore
|
||||
return;
|
||||
}
|
||||
|
||||
// get all or incremental set of distributor
|
||||
// get all or incremental set of distributors
|
||||
CDistributorList distributors;
|
||||
if (res.isRestricted())
|
||||
{
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace BlackCore
|
||||
|
||||
//! Get aircraft livery for ICAO code
|
||||
//! \threadsafe
|
||||
BlackMisc::Aviation::CLivery getStdLiveryForAirlineCode(const BlackMisc::Aviation::CAirlineIcaoCode &icao) const;
|
||||
BlackMisc::Aviation::CLivery getStdLiveryForAirlineVDesignator(const BlackMisc::Aviation::CAirlineIcaoCode &icao) const;
|
||||
|
||||
//! Get aircraft livery for id
|
||||
//! \threadsafe
|
||||
@@ -95,6 +95,10 @@ namespace BlackCore
|
||||
//! \threadsafe
|
||||
BlackMisc::Simulation::CDistributor smartDistributorSelector(const BlackMisc::Simulation::CDistributor &distributorPattern) const;
|
||||
|
||||
//! Best match specified by distributor
|
||||
//! \threadsafe
|
||||
BlackMisc::Simulation::CDistributor smartDistributorSelector(const BlackMisc::Simulation::CDistributor &distributorPattern, const BlackMisc::Simulation::CAircraftModel &model) const;
|
||||
|
||||
//! Get models count
|
||||
//! \threadsafe
|
||||
int getModelsCount() const;
|
||||
@@ -105,7 +109,7 @@ namespace BlackCore
|
||||
|
||||
//! Get model keys
|
||||
//! \threadsafe
|
||||
QStringList getModelStrings() const;
|
||||
QStringList getModelStringList() const;
|
||||
|
||||
//! All data read?
|
||||
//! \threadsafe
|
||||
|
||||
Reference in New Issue
Block a user