Ref T148, database reader extensions

* allow to set severity of failed reading
* get entities with cached data
* removed needsSharedInfoFileLoaded in CDatabaseReaderConfig
This commit is contained in:
Klaus Basan
2017-09-04 15:15:13 +02:00
committed by Mathew Sutcliffe
parent c0a6574c80
commit a2e888546e
12 changed files with 159 additions and 42 deletions

View File

@@ -152,7 +152,7 @@ namespace BlackCore
}
else
{
CLogMessage(this).error("No URL for %1") << CEntityFlags::flagToString(CEntityFlags::AircraftIcaoEntity);
this->logNoWorkingUrl(CEntityFlags::AircraftIcaoEntity);
}
}
@@ -167,7 +167,7 @@ namespace BlackCore
}
else
{
CLogMessage(this).error("No URL for %1") << CEntityFlags::flagToString(CEntityFlags::AirlineIcaoEntity);
this->logNoWorkingUrl(CEntityFlags::AirlineIcaoEntity);
}
}
@@ -182,7 +182,7 @@ namespace BlackCore
}
else
{
CLogMessage(this).error("No URL for %1") << CEntityFlags::flagToString(CEntityFlags::CountryEntity);
this->logNoWorkingUrl(CEntityFlags::CountryEntity);
}
}
@@ -557,6 +557,24 @@ namespace BlackCore
}
}
CEntityFlags::Entity CIcaoDataReader::getEntitiesWithCacheCount() const
{
CEntityFlags::Entity entities = CEntityFlags::NoEntity;
if (this->getCacheCount(CEntityFlags::AircraftIcaoEntity) > 0) entities |= CEntityFlags::AircraftIcaoEntity;
if (this->getCacheCount(CEntityFlags::AirlineIcaoEntity) > 0) entities |= CEntityFlags::AirlineIcaoEntity;
if (this->getCacheCount(CEntityFlags::CountryEntity) > 0) entities |= CEntityFlags::CountryEntity;
return entities;
}
CEntityFlags::Entity CIcaoDataReader::getEntitiesWithCacheTimestampNewerThan(const QDateTime &threshold) const
{
CEntityFlags::Entity entities = CEntityFlags::NoEntity;
if (this->hasCacheTimestampNewerThan(CEntityFlags::AircraftIcaoEntity, threshold)) entities |= CEntityFlags::AircraftIcaoEntity;
if (this->hasCacheTimestampNewerThan(CEntityFlags::AirlineIcaoEntity, threshold)) entities |= CEntityFlags::AirlineIcaoEntity;
if (this->hasCacheTimestampNewerThan(CEntityFlags::CountryEntity, threshold)) entities |= CEntityFlags::CountryEntity;
return entities;
}
bool CIcaoDataReader::hasChangedUrl(CEntityFlags::Entity entity, CUrl &oldUrlInfo, CUrl &newUrlInfo) const
{
Q_UNUSED(entity);