mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45:33 +08:00
refs #438 minor tweaks
* removed unused include * status to enum utility function * disconnect signals in network context
This commit is contained in:
@@ -147,6 +147,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
void CContextNetwork::gracefulShutdown()
|
void CContextNetwork::gracefulShutdown()
|
||||||
{
|
{
|
||||||
|
this->disconnect(); // all signals
|
||||||
if (this->m_vatsimBookingReader) { this->m_vatsimBookingReader->requestStop(); this->m_vatsimBookingReader->quit(); }
|
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->m_vatsimDataFileReader) { this->m_vatsimDataFileReader->requestStop(); this->m_vatsimDataFileReader->quit(); }
|
||||||
if (this->isConnected()) { this->disconnectFromNetwork(); }
|
if (this->isConnected()) { this->disconnectFromNetwork(); }
|
||||||
|
|||||||
@@ -45,6 +45,11 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ISimulator::SimulatorStatus ISimulator::statusToEnum(int status)
|
||||||
|
{
|
||||||
|
return static_cast<SimulatorStatus>(status);
|
||||||
|
}
|
||||||
|
|
||||||
void ISimulator::emitSimulatorCombinedStatus(int oldStatus)
|
void ISimulator::emitSimulatorCombinedStatus(int oldStatus)
|
||||||
{
|
{
|
||||||
int newStatus = getSimulatorStatus();
|
int newStatus = getSimulatorStatus();
|
||||||
|
|||||||
@@ -174,6 +174,10 @@ namespace BlackCore
|
|||||||
//! Status to string
|
//! Status to string
|
||||||
static QString statusToString(int status);
|
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:
|
signals:
|
||||||
//! Simulator combined status
|
//! Simulator combined status
|
||||||
//! \todo Qt5.5: Make use of QFlags
|
//! \todo Qt5.5: Make use of QFlags
|
||||||
@@ -256,7 +260,6 @@ namespace BlackCore
|
|||||||
signals:
|
signals:
|
||||||
//! Emitted when the listener discovers the simulator running.
|
//! Emitted when the listener discovers the simulator running.
|
||||||
void simulatorStarted();
|
void simulatorStarted();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Factory pattern class to create instances of ISimulator
|
//! Factory pattern class to create instances of ISimulator
|
||||||
@@ -283,7 +286,6 @@ namespace BlackCore
|
|||||||
virtual ISimulatorListener *createListener(QObject *parent = nullptr) = 0;
|
virtual ISimulatorListener *createListener(QObject *parent = nullptr) = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
Q_DECLARE_INTERFACE(BlackCore::ISimulatorFactory, "org.swift-project.blackcore.simulatorinterface")
|
Q_DECLARE_INTERFACE(BlackCore::ISimulatorFactory, "org.swift-project.blackcore.simulatorinterface")
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
* contained in the LICENSE file.
|
* contained in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blackmiscfreefunctions.h"
|
|
||||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||||
#include "blackmisc/simulation/simulatedaircraftlist.h"
|
#include "blackmisc/simulation/simulatedaircraftlist.h"
|
||||||
#include "blackmisc/simulation/simulatorplugininfolist.h"
|
#include "blackmisc/simulation/simulatorplugininfolist.h"
|
||||||
@@ -22,7 +21,6 @@ using namespace BlackMisc::Simulation::Fsx;
|
|||||||
using namespace BlackMisc::Simulation::FsCommon;
|
using namespace BlackMisc::Simulation::FsCommon;
|
||||||
using namespace BlackMisc::Simulation::Settings;
|
using namespace BlackMisc::Simulation::Settings;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Metadata for simulation
|
* Metadata for simulation
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user