From 631814bcbd289cf2e338a43e78b824ac98a8efd2 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 2 Jun 2015 00:24:22 +0200 Subject: [PATCH] refs #438 minor tweaks * removed unused include * status to enum utility function * disconnect signals in network context --- src/blackcore/context_network_impl.cpp | 1 + src/blackcore/simulator.cpp | 5 +++++ src/blackcore/simulator.h | 6 ++++-- src/blackmisc/blackmiscfreefunctions_simmeta.cpp | 2 -- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/blackcore/context_network_impl.cpp b/src/blackcore/context_network_impl.cpp index 8e9250830..a8bffb60c 100644 --- a/src/blackcore/context_network_impl.cpp +++ b/src/blackcore/context_network_impl.cpp @@ -147,6 +147,7 @@ namespace BlackCore void CContextNetwork::gracefulShutdown() { + this->disconnect(); // all signals if (this->m_vatsimBookingReader) { this->m_vatsimBookingReader->requestStop(); this->m_vatsimBookingReader->quit(); } if (this->m_vatsimDataFileReader) { this->m_vatsimDataFileReader->requestStop(); this->m_vatsimDataFileReader->quit(); } if (this->isConnected()) { this->disconnectFromNetwork(); } diff --git a/src/blackcore/simulator.cpp b/src/blackcore/simulator.cpp index ed49f8e58..f938d2ffa 100644 --- a/src/blackcore/simulator.cpp +++ b/src/blackcore/simulator.cpp @@ -45,6 +45,11 @@ namespace BlackCore } } + ISimulator::SimulatorStatus ISimulator::statusToEnum(int status) + { + return static_cast(status); + } + void ISimulator::emitSimulatorCombinedStatus(int oldStatus) { int newStatus = getSimulatorStatus(); diff --git a/src/blackcore/simulator.h b/src/blackcore/simulator.h index ce431d721..206d65da2 100644 --- a/src/blackcore/simulator.h +++ b/src/blackcore/simulator.h @@ -174,6 +174,10 @@ namespace BlackCore //! Status to string static QString statusToString(int status); + //! Status to enum + //! \todo remove with Qt 5.5 when SimulatorStatus can be transferred via DBus + static SimulatorStatus statusToEnum(int status); + signals: //! Simulator combined status //! \todo Qt5.5: Make use of QFlags @@ -256,7 +260,6 @@ namespace BlackCore signals: //! Emitted when the listener discovers the simulator running. void simulatorStarted(); - }; //! Factory pattern class to create instances of ISimulator @@ -283,7 +286,6 @@ namespace BlackCore virtual ISimulatorListener *createListener(QObject *parent = nullptr) = 0; }; - } // namespace Q_DECLARE_INTERFACE(BlackCore::ISimulatorFactory, "org.swift-project.blackcore.simulatorinterface") diff --git a/src/blackmisc/blackmiscfreefunctions_simmeta.cpp b/src/blackmisc/blackmiscfreefunctions_simmeta.cpp index d59edf7eb..4d1274452 100644 --- a/src/blackmisc/blackmiscfreefunctions_simmeta.cpp +++ b/src/blackmisc/blackmiscfreefunctions_simmeta.cpp @@ -7,7 +7,6 @@ * contained in the LICENSE file. */ -#include "blackmiscfreefunctions.h" #include "blackmisc/simulation/aircraftmodellist.h" #include "blackmisc/simulation/simulatedaircraftlist.h" #include "blackmisc/simulation/simulatorplugininfolist.h" @@ -22,7 +21,6 @@ using namespace BlackMisc::Simulation::Fsx; using namespace BlackMisc::Simulation::FsCommon; using namespace BlackMisc::Simulation::Settings; - /* * Metadata for simulation *