From 25df1921eb5f7a2028ace367a668cff57756784b Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Wed, 16 Jan 2019 19:45:13 +0100 Subject: [PATCH] Style --- src/blackcore/context/contextsimulator.h | 2 +- src/blackcore/context/contextsimulatorempty.h | 4 ++++ src/blackcore/context/contextsimulatorimpl.h | 2 +- src/blackcore/db/backgrounddataupdater.cpp | 2 +- src/blackcore/db/backgrounddataupdater.h | 4 ++-- src/blackgui/components/settingsmatchingcomponent.cpp | 3 --- src/blackgui/components/settingssimulatorcomponent.h | 2 +- src/blackgui/models/aircrafticaofilter.cpp | 6 +++--- src/blackmisc/worker.cpp | 2 +- 9 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/blackcore/context/contextsimulator.h b/src/blackcore/context/contextsimulator.h index d38fb49d9..a19c56f5c 100644 --- a/src/blackcore/context/contextsimulator.h +++ b/src/blackcore/context/contextsimulator.h @@ -271,7 +271,7 @@ namespace BlackCore //! Repeat all matchings virtual int doMatchingsAgain() = 0; - //! Repeat the matching + //! Repeat the matching callsign virtual bool doMatchingAgain(const BlackMisc::Aviation::CCallsign &callsign) = 0; //! Current matching statistics diff --git a/src/blackcore/context/contextsimulatorempty.h b/src/blackcore/context/contextsimulatorempty.h index b4259ce13..d5bbd6bda 100644 --- a/src/blackcore/context/contextsimulatorempty.h +++ b/src/blackcore/context/contextsimulatorempty.h @@ -347,6 +347,7 @@ namespace BlackCore virtual BlackMisc::Simulation::CMatchingStatistics getCurrentMatchingStatistics(bool missingOnly) const override { Q_UNUSED(missingOnly); + logEmptyContextWarning(Q_FUNC_INFO); return BlackMisc::Simulation::CMatchingStatistics(); } @@ -354,11 +355,13 @@ namespace BlackCore virtual void setMatchingSetup(const BlackMisc::Simulation::CAircraftMatcherSetup &setup) override { Q_UNUSED(setup); + logEmptyContextWarning(Q_FUNC_INFO); } //! \copydoc IContextSimulator::setMatchingSetup virtual BlackMisc::Simulation::CAircraftMatcherSetup getMatchingSetup() const override { + logEmptyContextWarning(Q_FUNC_INFO); return BlackMisc::Simulation::CAircraftMatcherSetup(); } @@ -368,6 +371,7 @@ namespace BlackCore Q_UNUSED(simulator); return BlackMisc::CStatusMessageList(); } + }; } // namespace } // namespace diff --git a/src/blackcore/context/contextsimulatorimpl.h b/src/blackcore/context/contextsimulatorimpl.h index 1071552bc..ce6450370 100644 --- a/src/blackcore/context/contextsimulatorimpl.h +++ b/src/blackcore/context/contextsimulatorimpl.h @@ -250,11 +250,11 @@ namespace BlackCore void initByLastUsedModelSet(); QPair> m_simulatorPlugin; //!< Currently loaded simulator plugin + QMap m_matchingMessages; //!< all matching log messages per callsign CPluginManagerSimulator *m_plugins = nullptr; //!< plugin manager BlackMisc::CRegularThread m_listenersThread; //!< waiting for plugin CWeatherManager m_weatherManager { this }; //!< weather management CAircraftMatcher m_aircraftMatcher { this }; //!< model matcher - QMap m_matchingMessages; //!< all matching log messages per callsign bool m_wasSimulating = false; bool m_initallyAddAircraft = false; diff --git a/src/blackcore/db/backgrounddataupdater.cpp b/src/blackcore/db/backgrounddataupdater.cpp index 48a460cd4..bdc4ec2e4 100644 --- a/src/blackcore/db/backgrounddataupdater.cpp +++ b/src/blackcore/db/backgrounddataupdater.cpp @@ -31,7 +31,7 @@ namespace BlackCore { const CLogCategoryList &CBackgroundDataUpdater::getLogCategories() { - static const BlackMisc::CLogCategoryList cats { BlackMisc::CLogCategory::worker() }; + static const CLogCategoryList cats({ CLogCategory::worker(), CLogCategory::modelSetCache(), CLogCategory::modelCache() }); return cats; } diff --git a/src/blackcore/db/backgrounddataupdater.h b/src/blackcore/db/backgrounddataupdater.h index f55596592..9654010d2 100644 --- a/src/blackcore/db/backgrounddataupdater.h +++ b/src/blackcore/db/backgrounddataupdater.h @@ -14,8 +14,8 @@ #include "blackcore/data/dbcaches.h" #include "blackcore/blackcoreexport.h" -#include "blackmisc/network/entityflags.h" #include "blackmisc/simulation/data/modelcaches.h" +#include "blackmisc/network/entityflags.h" #include "blackmisc/statusmessagelist.h" #include "blackmisc/worker.h" @@ -48,7 +48,7 @@ namespace BlackCore void consolidating(bool running); private: - mutable QReadWriteLock m_lockMsg; //!< lock snapshot + mutable QReadWriteLock m_lockMsg; //!< lock history messages std::atomic_int m_cycle { 0 }; //!< cycle std::atomic_bool m_inWork { false }; //!< indicates a running update std::atomic_bool m_updatePublishedModels { true }; //!< update when models have been updated diff --git a/src/blackgui/components/settingsmatchingcomponent.cpp b/src/blackgui/components/settingsmatchingcomponent.cpp index a9c3fe874..ba2687818 100644 --- a/src/blackgui/components/settingsmatchingcomponent.cpp +++ b/src/blackgui/components/settingsmatchingcomponent.cpp @@ -61,9 +61,6 @@ namespace BlackGui void CSettingsMatchingComponent::showButtons(bool show) { ui->fr_Buttons->setVisible(show); - // ui->pb_MatchingAgain->setVisible(show); - // ui->pb_Reload->setVisible(show); - // ui->pb_Save->setVisible(show); } void CSettingsMatchingComponent::onSavePressed() const diff --git a/src/blackgui/components/settingssimulatorcomponent.h b/src/blackgui/components/settingssimulatorcomponent.h index 42c33f9c8..2b1c0e3ef 100644 --- a/src/blackgui/components/settingssimulatorcomponent.h +++ b/src/blackgui/components/settingssimulatorcomponent.h @@ -22,9 +22,9 @@ #include #include +namespace Ui { class CSettingsSimulatorComponent; } namespace BlackCore { class CPluginManagerSimulator; } namespace BlackMisc { namespace Simulation { class CSimulatorPluginInfo; } } -namespace Ui { class CSettingsSimulatorComponent; } namespace BlackGui { namespace Components diff --git a/src/blackgui/models/aircrafticaofilter.cpp b/src/blackgui/models/aircrafticaofilter.cpp index 0e43ae2dc..b55e37a12 100644 --- a/src/blackgui/models/aircrafticaofilter.cpp +++ b/src/blackgui/models/aircrafticaofilter.cpp @@ -27,15 +27,15 @@ namespace BlackGui m_description(description.trimmed()), m_combinedType(combinedType.trimmed().toUpper()) { - this->m_valid = !(this->m_id < 0 && this->m_combinedType.isEmpty() && this->m_designator.isEmpty() && - this->m_family.isEmpty() && this->m_description.isEmpty() && this->m_manufacturer.isEmpty()); + m_valid = !(m_id < 0 && m_combinedType.isEmpty() && m_designator.isEmpty() && + m_family.isEmpty() && m_description.isEmpty() && m_manufacturer.isEmpty()); } CAircraftIcaoCodeList CAircraftIcaoFilter::filter(const CAircraftIcaoCodeList &inContainer) const { if (!this->isValid()) { return inContainer; } CAircraftIcaoCodeList outContainer; - const bool filterCombinedCode = !this->m_combinedType.isEmpty() && !this->m_combinedType.contains('-') && CAircraftIcaoCode::isValidCombinedType(this->m_combinedType); + const bool filterCombinedCode = !m_combinedType.isEmpty() && !m_combinedType.contains('-') && CAircraftIcaoCode::isValidCombinedType(m_combinedType); for (const CAircraftIcaoCode &icao : inContainer) { diff --git a/src/blackmisc/worker.cpp b/src/blackmisc/worker.cpp index 1624b09af..917cdabbb 100644 --- a/src/blackmisc/worker.cpp +++ b/src/blackmisc/worker.cpp @@ -195,7 +195,7 @@ namespace BlackMisc void CContinuousWorker::startUpdating(int updateTimeSecs) { - Q_ASSERT_X(hasStarted(), Q_FUNC_INFO, "Worker not yet started"); + Q_ASSERT_X(this->hasStarted(), Q_FUNC_INFO, "Worker not yet started"); if (!CThreadUtils::isCurrentThreadObjectThread(this)) { // shift in correct thread