mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
refs #811, get count in readers/services
This commit is contained in:
@@ -32,6 +32,11 @@ namespace BlackCore
|
||||
return m_airportCache.get();
|
||||
}
|
||||
|
||||
int CAirportDataReader::getAirportsCount() const
|
||||
{
|
||||
return this->getAirports().size();
|
||||
}
|
||||
|
||||
QDateTime CAirportDataReader::getCacheTimestamp(CEntityFlags::Entity entities) const
|
||||
{
|
||||
return entities == CEntityFlags::AirportEntity ? m_airportCache.getAvailableTimestamp() : QDateTime();
|
||||
|
||||
@@ -38,6 +38,10 @@ namespace BlackCore
|
||||
//! \threadsafe
|
||||
BlackMisc::Aviation::CAirportList getAirports() const;
|
||||
|
||||
//! Returns a list of all airports in the database.
|
||||
//! \threadsafe
|
||||
int getAirportsCount() const;
|
||||
|
||||
// base class overrides
|
||||
virtual QDateTime getCacheTimestamp(BlackMisc::Network::CEntityFlags::Entity entities) const override;
|
||||
virtual int getCacheCount(BlackMisc::Network::CEntityFlags::Entity entity) const override;
|
||||
|
||||
@@ -571,6 +571,12 @@ namespace BlackCore
|
||||
return CAirportList();
|
||||
}
|
||||
|
||||
int CWebDataServices::getAirportsCount() const
|
||||
{
|
||||
if (m_airportDataReader) { return m_airportDataReader->getAirportsCount(); }
|
||||
return 0;
|
||||
}
|
||||
|
||||
CCountry CWebDataServices::getCountryForIsoCode(const QString &iso) const
|
||||
{
|
||||
if (m_icaoDataReader) { return m_icaoDataReader->getCountryForIsoCode(iso); }
|
||||
|
||||
@@ -291,6 +291,10 @@ namespace BlackCore
|
||||
//! \\threadsafe
|
||||
BlackMisc::Aviation::CAirportList getAirports() const;
|
||||
|
||||
//! Get airports count
|
||||
//! \\threadsafe
|
||||
int getAirportsCount() const;
|
||||
|
||||
//! Get METARs
|
||||
//! \threadsafe
|
||||
BlackMisc::Weather::CMetarList getMetars() const;
|
||||
|
||||
Reference in New Issue
Block a user