mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Ref T201, fixes for info object overview
* more detailed log info
* sort info objects so the correct value is obtained ("raw" names)
* check both "duplicate" strings
This commit is contained in:
@@ -50,7 +50,7 @@ namespace BlackCore
|
||||
|
||||
// we accept cached data
|
||||
Q_ASSERT_X(!entities.testFlag(CEntityFlags::DbInfoObjectEntity), Q_FUNC_INFO, "Read info objects directly");
|
||||
const bool hasInfoObjects = this->hasDbInfoObjects(); // no info objects is not necessarily an error, but indicates a) either data not available (DB down) or b) only caches are used
|
||||
const bool hasDbInfoObjects = this->hasDbInfoObjects(); // no info objects is not necessarily an error, but indicates a) either data not available (DB down) or b) only caches are used
|
||||
CEntityFlags::Entity allEntities = entities;
|
||||
CEntityFlags::Entity cachedEntities = CEntityFlags::NoEntity;
|
||||
CEntityFlags::Entity dbEntities = CEntityFlags::NoEntity;
|
||||
@@ -77,7 +77,7 @@ namespace BlackCore
|
||||
else if (rm.testFlag(CDbFlags::Cached))
|
||||
{
|
||||
// info object comparisons only for: cache + shared or cache + DB data
|
||||
if (hasInfoObjects && rmDbReadingOrShared)
|
||||
if (hasDbInfoObjects && rmDbReadingOrShared)
|
||||
{
|
||||
// check mode here for consistency
|
||||
Q_ASSERT_X(!getBaseUrl(rmDbOrSharedFlag).isEmpty(), Q_FUNC_INFO, "Wrong retrieval mode");
|
||||
@@ -116,8 +116,8 @@ namespace BlackCore
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!rmDbReadingOrShared) { CLogMessage(this).info("No DB or shared reading for '%1'") << currentEntityName; }
|
||||
if (!hasInfoObjects) { CLogMessage(this).info("No info objects for '%1'") << currentEntityName; }
|
||||
if (!rmDbReadingOrShared) { CLogMessage(this).info("No DB or shared reading for '%1', read mode is: '%2'") << currentEntityName << rmString; }
|
||||
if (!hasDbInfoObjects) { CLogMessage(this).info("No DB info objects for '%1', read mode is: '%2'") << currentEntityName << rmString; }
|
||||
if (currentEntityCount > 0)
|
||||
{
|
||||
CLogMessage(this).info("Cache for '%1' already read, %2 entries") << currentEntityName << currentEntityCount;
|
||||
|
||||
@@ -367,7 +367,7 @@ namespace BlackMisc
|
||||
bool CAircraftIcaoCode::isDbDuplicate() const
|
||||
{
|
||||
return m_modelIataDescription.startsWith("duplicate", Qt::CaseInsensitive) ||
|
||||
m_modelSwiftDescription.startsWith("duplicate", Qt::CaseInsensitive);
|
||||
m_modelSwiftDescription.startsWith("do not", Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
void CAircraftIcaoCode::setCodeFlags(bool military, bool legacy, bool realWorld)
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace BlackMisc
|
||||
const CDbInfo info(CDbInfo::fromDatabaseJson(value.toObject()));
|
||||
infoObjects.push_back(info);
|
||||
}
|
||||
infoObjects.sortByKey(); // make sure the data are in proper order
|
||||
return infoObjects;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user