From 12b2bc4181bb45753af78c0044e17abdc831b8ab Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Thu, 23 Nov 2017 03:28:59 +0100 Subject: [PATCH] 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 --- src/blackcore/db/databasereader.cpp | 8 ++++---- src/blackmisc/aviation/aircrafticaocode.cpp | 2 +- src/blackmisc/db/dbinfolist.cpp | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/blackcore/db/databasereader.cpp b/src/blackcore/db/databasereader.cpp index b1f6e2f43..1a9951214 100644 --- a/src/blackcore/db/databasereader.cpp +++ b/src/blackcore/db/databasereader.cpp @@ -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; diff --git a/src/blackmisc/aviation/aircrafticaocode.cpp b/src/blackmisc/aviation/aircrafticaocode.cpp index 010541b24..e3ef15b43 100644 --- a/src/blackmisc/aviation/aircrafticaocode.cpp +++ b/src/blackmisc/aviation/aircrafticaocode.cpp @@ -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) diff --git a/src/blackmisc/db/dbinfolist.cpp b/src/blackmisc/db/dbinfolist.cpp index 6e7ce8751..1c13eb4fa 100644 --- a/src/blackmisc/db/dbinfolist.cpp +++ b/src/blackmisc/db/dbinfolist.cpp @@ -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