diff --git a/src/blackcore/context/contextsimulator.cpp b/src/blackcore/context/contextsimulator.cpp index 35d34365a..201bd7fca 100644 --- a/src/blackcore/context/contextsimulator.cpp +++ b/src/blackcore/context/contextsimulator.cpp @@ -15,6 +15,7 @@ #include +using namespace BlackConfig; using namespace BlackMisc; using namespace BlackMisc::PhysicalQuantities; @@ -62,7 +63,7 @@ namespace BlackCore bool IContextSimulator::isSimulatorAvailable() const { - return BlackConfig::CBuildConfig::isCompiledWithFlightSimulatorSupport() && !getSimulatorPluginInfo().isUnspecified(); + return CBuildConfig::isCompiledWithFlightSimulatorSupport() && !getSimulatorPluginInfo().isUnspecified(); } bool IContextSimulator::isSimulatorSimulating() const diff --git a/src/blackcore/context/contextsimulatorimpl.cpp b/src/blackcore/context/contextsimulatorimpl.cpp index 534820536..1e6dd02e6 100644 --- a/src/blackcore/context/contextsimulatorimpl.cpp +++ b/src/blackcore/context/contextsimulatorimpl.cpp @@ -815,7 +815,8 @@ namespace BlackCore void CContextSimulator::relayStatusMessageToSimulator(const BlackMisc::CStatusMessage &message) { - if (!this->isSimulatorAvailable()) { return; } + if (!this->isSimulatorAvailable()) { return; } + if (!sApp || sApp->isShuttingDown()) { return; } const CSimulatorMessagesSettings simMsg = m_messageSettings.getThreadLocal(); if (simMsg.relayThisStatusMessage(message) && m_simulatorPlugin.second) { diff --git a/src/blackmisc/propertyindexvariantmap.h b/src/blackmisc/propertyindexvariantmap.h index f67024c2a..8a803473a 100644 --- a/src/blackmisc/propertyindexvariantmap.h +++ b/src/blackmisc/propertyindexvariantmap.h @@ -304,7 +304,7 @@ namespace BlackMisc case IndexPixmap: case IndexString: default: - break; + break; // also covers } // slow, only last resort diff --git a/src/blackmisc/statusmessage.cpp b/src/blackmisc/statusmessage.cpp index 99cf2436b..e0b4c9bc9 100644 --- a/src/blackmisc/statusmessage.cpp +++ b/src/blackmisc/statusmessage.cpp @@ -36,7 +36,7 @@ namespace BlackMisc temp.resize(0); // unlike clear(), resize(0) doesn't release the capacity if there are no implicitly shared copies quint64 unusedArgs = (1ULL << std::min(63, args.size())) - 1; - for (auto it = format.begin(); ; ) + for (auto it = format.begin(); ;) { const auto pc = std::find(it, format.end(), u'%'); temp.append(&*it, std::distance(it, pc)); @@ -475,18 +475,16 @@ namespace BlackMisc switch (i) { case IndexMessageAsHtml: - case IndexMessage: - return this->getMessage().compare(compareValue.getMessage()); + case IndexMessage: return this->getMessage().compare(compareValue.getMessage()); case IndexSeverityAsString: case IndexSeverityAsIcon: - case IndexSeverity: return Compare::compare(this->getSeverity(), compareValue.getSeverity()); + case IndexSeverity: return Compare::compare(this->getSeverity(), compareValue.getSeverity()); case IndexCategoriesAsString: return this->getCategoriesAsString().compare(compareValue.getCategoriesAsString()); - case IndexCategoriesHumanReadableAsString: return this->getHumanReadablePattern().compare(compareValue.getHumanReadablePattern()); + case IndexCategoriesHumanReadableAsString: return this->getHumanReadablePattern().compare(compareValue.getHumanReadablePattern()); case IndexCategoryHumanReadableOrTechnicalAsString: return this->getHumanOrTechnicalCategoriesAsString().compare(compareValue.getHumanOrTechnicalCategoriesAsString()); default: break; } - Q_ASSERT_X(false, Q_FUNC_INFO, "Comapre failed"); - return 0; + return CValueObject::comparePropertyByIndex(index, compareValue); } QString CStatusMessage::toHtml(bool withIcon, bool withColors) const diff --git a/src/xswiftbus/dbusserver.h b/src/xswiftbus/dbusserver.h index a551dafc9..c0c503e81 100644 --- a/src/xswiftbus/dbusserver.h +++ b/src/xswiftbus/dbusserver.h @@ -38,7 +38,7 @@ namespace XSwiftBus CDBusServer(); //! Destructor - ~CDBusServer(); + ~CDBusServer() override; //! Set the dispatcher void setDispatcher(CDBusDispatcher *dispatcher);