refs #720, adjusted exposed functions to new naming

* some minor formatting
* use the new condolidation functions
This commit is contained in:
Klaus Basan
2016-08-09 01:45:09 +02:00
committed by Mathew Sutcliffe
parent d9a35563e3
commit 1167735897
11 changed files with 45 additions and 21 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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())
{

View File

@@ -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