From afe4a0921813f280217277c5cb933e85cca25b5a Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Wed, 16 May 2018 21:15:34 +0200 Subject: [PATCH] Formatting --- samples/blackmisc/samplescontainer.cpp | 1 - src/blackcore/context/contextsimulatorimpl.h | 8 ++++---- src/blackcore/simulator.h | 2 +- src/blackcore/simulatorcommon.h | 2 +- src/blackgui/guiutility.cpp | 7 ++----- src/blackmisc/simulation/remoteaircraftprovider.cpp | 4 ++-- src/blackmisc/simulation/remoteaircraftprovider.h | 2 +- src/blackmisc/variant.cpp | 8 ++++---- .../simulator/emulatedconfig/simulatoremulatedconfig.cpp | 4 ++-- 9 files changed, 17 insertions(+), 21 deletions(-) diff --git a/samples/blackmisc/samplescontainer.cpp b/samples/blackmisc/samplescontainer.cpp index 5fbf7ecb1..213f4fe19 100644 --- a/samples/blackmisc/samplescontainer.cpp +++ b/samples/blackmisc/samplescontainer.cpp @@ -93,5 +93,4 @@ namespace BlackSample return 0; } - } // namespace diff --git a/src/blackcore/context/contextsimulatorimpl.h b/src/blackcore/context/contextsimulatorimpl.h index bbd8ac408..8dacb6741 100644 --- a/src/blackcore/context/contextsimulatorimpl.h +++ b/src/blackcore/context/contextsimulatorimpl.h @@ -133,10 +133,10 @@ namespace BlackCore static void registerHelp() { if (BlackMisc::CSimpleCommandParser::registered("BlackCore::CContextSimulator")) { return; } - BlackMisc::CSimpleCommandParser::registerCommand({".ris", "rendering/interpolation setup"}); - BlackMisc::CSimpleCommandParser::registerCommand({".ris show", "display rendering/interpolation setup on console"}); - BlackMisc::CSimpleCommandParser::registerCommand({".ris debug on|off", "rendering/interpolation debug messages"}); - BlackMisc::CSimpleCommandParser::registerCommand({".ris parts on|off", "aircraft parts"}); + BlackMisc::CSimpleCommandParser::registerCommand({".ris", "rendering/interpolation setup (global setup)"}); + BlackMisc::CSimpleCommandParser::registerCommand({".ris show", "display rendering/interpolation setup on console (global setup)"}); + BlackMisc::CSimpleCommandParser::registerCommand({".ris debug on|off", "rendering/interpolation debug messages (global setup)"}); + BlackMisc::CSimpleCommandParser::registerCommand({".ris parts on|off", "aircraft parts (global setup)"}); } signals: diff --git a/src/blackcore/simulator.h b/src/blackcore/simulator.h index e25627d9c..f31c932c5 100644 --- a/src/blackcore/simulator.h +++ b/src/blackcore/simulator.h @@ -88,7 +88,7 @@ namespace BlackCore //! Is time synchronization on? virtual bool isTimeSynchronized() const = 0; - //! Get the setup (simulator environemnt) + //! Get the setup (simulator environment) virtual const BlackMisc::Simulation::CSimulatorInternals &getSimulatorInternals() const = 0; //! Connect to simulator diff --git a/src/blackcore/simulatorcommon.h b/src/blackcore/simulatorcommon.h index 8b7bfcd1a..3a1102ba4 100644 --- a/src/blackcore/simulatorcommon.h +++ b/src/blackcore/simulatorcommon.h @@ -223,7 +223,7 @@ namespace BlackCore qint64 m_statsUpdateAircraftTimeTotalMs = 0; //!< statistics update time qint64 m_statsUpdateAircraftTimeAvgMs = 0; //!< statistics update time BlackMisc::Simulation::CSimulatorInternals m_simulatorInternals; //!< setup object - BlackMisc::Simulation::CInterpolationLogger m_interpolationLogger; //!< log interpolation + BlackMisc::Simulation::CInterpolationLogger m_interpolationLogger; //!< log.interpolation QMap m_clampedLogMsg; //!< when logged last so there, can be used so there is no log message overflow // some optional functionality which can be used by the simulators as needed diff --git a/src/blackgui/guiutility.cpp b/src/blackgui/guiutility.cpp index a30b95153..7bb39d730 100644 --- a/src/blackgui/guiutility.cpp +++ b/src/blackgui/guiutility.cpp @@ -168,11 +168,8 @@ namespace BlackGui CVariant CGuiUtility::fromSwiftDragAndDropData(const QMimeData *mime) { - if (hasSwiftVariantMimeType(mime)) - { - return fromSwiftDragAndDropData(mime->data(swiftJsonDragAndDropMimeType())); - } - return CVariant(); + if (!hasSwiftVariantMimeType(mime)) { return CVariant(); } + return CGuiUtility::fromSwiftDragAndDropData(mime->data(swiftJsonDragAndDropMimeType())); } CVariant CGuiUtility::fromSwiftDragAndDropData(const QByteArray &utf8Data) diff --git a/src/blackmisc/simulation/remoteaircraftprovider.cpp b/src/blackmisc/simulation/remoteaircraftprovider.cpp index 87db81b05..6b2f94721 100644 --- a/src/blackmisc/simulation/remoteaircraftprovider.cpp +++ b/src/blackmisc/simulation/remoteaircraftprovider.cpp @@ -342,9 +342,9 @@ namespace BlackMisc } } - bool CRemoteAircraftProvider::updateAircraftEnabled(const CCallsign &callsign, bool enabledForRedering) + bool CRemoteAircraftProvider::updateAircraftEnabled(const CCallsign &callsign, bool enabledForRendering) { - const CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexEnabled, CVariant::fromValue(enabledForRedering)); + const CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexEnabled, CVariant::fromValue(enabledForRendering)); const int c = this->updateAircraftInRange(callsign, vm); return c > 0; } diff --git a/src/blackmisc/simulation/remoteaircraftprovider.h b/src/blackmisc/simulation/remoteaircraftprovider.h index 7d558c1cd..7f11b48a0 100644 --- a/src/blackmisc/simulation/remoteaircraftprovider.h +++ b/src/blackmisc/simulation/remoteaircraftprovider.h @@ -256,7 +256,7 @@ namespace BlackMisc virtual bool isRemoteAircraftSupportingParts(const Aviation::CCallsign &callsign) const override; virtual int getRemoteAircraftSupportingPartsCount() const override; virtual Aviation::CCallsignSet remoteAircraftSupportingParts() const override; - virtual bool updateAircraftEnabled(const Aviation::CCallsign &callsign, bool enabledForRedering) override; + virtual bool updateAircraftEnabled(const Aviation::CCallsign &callsign, bool enabledForRendering) override; virtual bool updateAircraftModel(const Aviation::CCallsign &callsign, const CAircraftModel &model, const CIdentifier &originator) override; virtual bool updateAircraftNetworkModel(const Aviation::CCallsign &callsign, const CAircraftModel &model, const CIdentifier &originator) override; virtual bool updateFastPositionEnabled(const Aviation::CCallsign &callsign, bool enableFastPositonUpdates) override; diff --git a/src/blackmisc/variant.cpp b/src/blackmisc/variant.cpp index 761f0aa35..be6e38427 100644 --- a/src/blackmisc/variant.cpp +++ b/src/blackmisc/variant.cpp @@ -162,13 +162,13 @@ namespace BlackMisc { // Remark: Names "type" and "value" are also used for drag and drop // Changing the names here requires the change for drag and drop too - QJsonValue typeValue = json.value("type"); + const QJsonValue typeValue = json.value("type"); if (typeValue.isUndefined()) { throw CJsonException("Missing 'type'"); } - QString typeName = typeValue.toString(); + const QString typeName = typeValue.toString(); if (typeName.isEmpty()) { m_v.clear(); return; } - int typeId = QMetaType::type(qPrintable(typeName)); + const int typeId = QMetaType::type(qPrintable(typeName)); - QJsonValue value = json.value("value"); + const QJsonValue value = json.value("value"); if (value.isUndefined()) { throw CJsonException("Missing 'value'"); } switch (typeId) { diff --git a/src/plugins/simulator/emulatedconfig/simulatoremulatedconfig.cpp b/src/plugins/simulator/emulatedconfig/simulatoremulatedconfig.cpp index ce2b87654..e90cb0f64 100644 --- a/src/plugins/simulator/emulatedconfig/simulatoremulatedconfig.cpp +++ b/src/plugins/simulator/emulatedconfig/simulatoremulatedconfig.cpp @@ -23,5 +23,5 @@ namespace BlackSimPlugin { return new CSimulatorEmulatedConfigWidget(parent); } - } -} + } // ns +} // ns