From 1b7f1b16620bef747042d6b569713fe2b00b40dc Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Thu, 7 Feb 2019 23:46:44 +0100 Subject: [PATCH] Minor reader formatting/comments --- src/blackcore/application.cpp | 5 +++-- src/blackcore/db/infodatareader.cpp | 4 ++-- src/blackcore/webreaderflags.cpp | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/blackcore/application.cpp b/src/blackcore/application.cpp index 9a02a3bef..fefa49e80 100644 --- a/src/blackcore/application.cpp +++ b/src/blackcore/application.cpp @@ -719,6 +719,7 @@ namespace BlackCore const QFileInfo fi(saveAsFileName); if (!fi.dir().exists()) { return nullptr; } + // function called with reply when done CallbackSlot callbackSlot([ = ](QNetworkReply * reply) { QScopedPointer nwReply(reply); @@ -731,7 +732,7 @@ namespace BlackCore { const bool ok = CFileUtils::writeByteArrayToFile(reply->readAll(), saveAsFileName); msg = ok ? - CStatusMessage(this, CStatusMessage::SeverityInfo, u"Saved file '%1' downloaded from '%2'") << saveAsFileName << url.getFullUrl() : + CStatusMessage(this, CStatusMessage::SeverityInfo, u"Saved file '%1' downloaded from '%2'") << saveAsFileName << url.getFullUrl() : CStatusMessage(this, CStatusMessage::SeverityError, u"Saving file '%1' downloaded from '%2' failed") << saveAsFileName << url.getFullUrl(); } nwReply->close(); @@ -1803,7 +1804,7 @@ namespace BlackCore // called when there are no more callbacks callback(reply); - }, Qt::QueuedConnection); + }, Qt::QueuedConnection); // called in callback thread } return reply; } diff --git a/src/blackcore/db/infodatareader.cpp b/src/blackcore/db/infodatareader.cpp index 7571ad41c..47218f6c9 100644 --- a/src/blackcore/db/infodatareader.cpp +++ b/src/blackcore/db/infodatareader.cpp @@ -205,8 +205,8 @@ namespace BlackCore CEntityFlags::EntityFlag CInfoDataReader::getEntityForMode() const { - if (m_mode == CDbFlags::DbReading) return CEntityFlags::DbInfoObjectEntity; - if (m_mode == CDbFlags::Shared) return CEntityFlags::SharedInfoObjectEntity; + if (m_mode == CDbFlags::DbReading) { return CEntityFlags::DbInfoObjectEntity; } + if (m_mode == CDbFlags::Shared) { return CEntityFlags::SharedInfoObjectEntity; } qFatal("Wrong mode"); return CEntityFlags::NoEntity; } diff --git a/src/blackcore/webreaderflags.cpp b/src/blackcore/webreaderflags.cpp index 71a913f61..ec9c738b5 100644 --- a/src/blackcore/webreaderflags.cpp +++ b/src/blackcore/webreaderflags.cpp @@ -16,8 +16,9 @@ namespace BlackCore CWebReaderFlags::WebReader CWebReaderFlags::entitiesToReaders(CEntityFlags::Entity entities) { WebReader f = None; - if (entities.testFlag(CEntityFlags::AircraftIcaoEntity) || entities.testFlag(CEntityFlags::AirlineIcaoEntity) || - entities.testFlag(CEntityFlags::CountryEntity) || entities.testFlag(CEntityFlags::AircraftCategoryEntity)) + if ( + entities.testFlag(CEntityFlags::AircraftIcaoEntity) || entities.testFlag(CEntityFlags::AirlineIcaoEntity) || + entities.testFlag(CEntityFlags::CountryEntity) || entities.testFlag(CEntityFlags::AircraftCategoryEntity)) { f |= IcaoDataReader; }