mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
refs #395, allow to disconnect SIGNAL/SLOTS from provider and gracefully shutdown airspace and analyzer
This commit is contained in:
committed by
Mathew Sutcliffe
parent
f18cfed087
commit
a6591cfe2c
@@ -27,6 +27,7 @@ namespace BlackMisc
|
||||
//! Direct thread safe in memory access to remote aircraft
|
||||
//! \note Can not be derived from QObject (as for the signals), as this would create multiple
|
||||
//! inheritance. Hence Q_DECLARE_INTERFACE is used.
|
||||
//! \ingroup remoteaircraftprovider
|
||||
class BLACKMISC_EXPORT IRemoteAircraftProvider
|
||||
{
|
||||
public:
|
||||
@@ -106,6 +107,10 @@ namespace BlackMisc
|
||||
std::function<void(const BlackMisc::Simulation::CAirspaceAircraftSnapshot &)> aircraftSnapshot
|
||||
) = 0;
|
||||
|
||||
//! Disconnect signals from receiver. As the interface is no QObject, slots can not be connected directly.
|
||||
virtual bool disconnectRemoteAircraftProviderSignals(
|
||||
QObject *receiver
|
||||
) = 0;
|
||||
};
|
||||
|
||||
//! Class which can be directly used to access an \sa IRemoteAircraftProvider object
|
||||
|
||||
@@ -80,6 +80,12 @@ namespace BlackMisc
|
||||
return s1 && s2 && s3 && s4;
|
||||
}
|
||||
|
||||
bool CRemoteAircraftProviderDummy::disconnectRemoteAircraftProviderSignals(QObject *receiver)
|
||||
{
|
||||
if (!receiver) { return false; }
|
||||
return this->disconnect(receiver);
|
||||
}
|
||||
|
||||
bool CRemoteAircraftProviderDummy::updateAircraftEnabled(const CCallsign &callsign, bool enabledForRendering, const QString &originator)
|
||||
{
|
||||
Q_UNUSED(originator);
|
||||
|
||||
@@ -67,6 +67,9 @@ namespace BlackMisc
|
||||
std::function<void(const BlackMisc::Simulation::CAirspaceAircraftSnapshot &)> aircraftSnapshotSlot
|
||||
) override;
|
||||
|
||||
//! \copydoc IRemoteAircraftProvider::disconnectRemoteAircraftProviderSignals
|
||||
virtual bool disconnectRemoteAircraftProviderSignals(QObject *receiver) override;
|
||||
|
||||
//! \copydoc IRemoteAircraftProvider::updateAircraftEnabled
|
||||
virtual bool updateAircraftEnabled(const BlackMisc::Aviation::CCallsign &callsign, bool enabledForRendering, const QString &originator) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user