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

@@ -179,7 +179,7 @@ namespace BlackCore
}
else
{
CLogMessage(this).error("No URL for %1") << CEntityFlags::flagToString(CEntityFlags::LiveryEntity);
this->logNoWorkingUrl(CEntityFlags::LiveryEntity);
}
}
@@ -194,7 +194,7 @@ namespace BlackCore
}
else
{
CLogMessage(this).error("No URL for %1") << CEntityFlags::flagToString(CEntityFlags::DistributorEntity);
this->logNoWorkingUrl(CEntityFlags::DistributorEntity);
}
}
@@ -209,7 +209,7 @@ namespace BlackCore
}
else
{
CLogMessage(this).error("No URL for %1") << CEntityFlags::flagToString(CEntityFlags::ModelEntity);
this->logNoWorkingUrl(CEntityFlags::ModelEntity);
}
}
@@ -569,6 +569,24 @@ namespace BlackCore
}
}
CEntityFlags::Entity CModelDataReader::getEntitiesWithCacheCount() const
{
CEntityFlags::Entity entities = CEntityFlags::NoEntity;
if (this->getCacheCount(CEntityFlags::LiveryEntity) > 0) entities |= CEntityFlags::LiveryEntity;
if (this->getCacheCount(CEntityFlags::ModelEntity) > 0) entities |= CEntityFlags::ModelEntity;
if (this->getCacheCount(CEntityFlags::DistributorEntity) > 0) entities |= CEntityFlags::DistributorEntity;
return entities;
}
CEntityFlags::Entity CModelDataReader::getEntitiesWithCacheTimestampNewerThan(const QDateTime &threshold) const
{
CEntityFlags::Entity entities = CEntityFlags::NoEntity;
if (this->hasCacheTimestampNewerThan(CEntityFlags::LiveryEntity, threshold)) entities |= CEntityFlags::LiveryEntity;
if (this->hasCacheTimestampNewerThan(CEntityFlags::ModelEntity, threshold)) entities |= CEntityFlags::ModelEntity;
if (this->hasCacheTimestampNewerThan(CEntityFlags::DistributorEntity, threshold)) entities |= CEntityFlags::DistributorEntity;
return entities;
}
bool CModelDataReader::hasChangedUrl(CEntityFlags::Entity entity, CUrl &oldUrlInfo, CUrl &newUrlInfo) const
{
Q_UNUSED(entity);