Fix missing removedAircraft signals when disconnecting from network

This commit is contained in:
Roland Winklmeier
2014-10-05 21:18:43 +02:00
parent 23c54a968d
commit 522c1263ef
2 changed files with 27 additions and 4 deletions

View File

@@ -341,6 +341,26 @@ namespace BlackCore
} }
} }
void CAirspaceMonitor::removeAllAtcStations()
{
m_atcWatchdog.removeAll();
m_atcStationsOnline.clear();
}
void CAirspaceMonitor::removeAllAircrafts()
{
m_aircraftWatchdog.removeAll();
for(CAircraft aircraft : m_aircraftsInRange)
emit removedAircraft(aircraft.getCallsign());
m_aircraftsInRange.clear();
}
void CAirspaceMonitor::removeAllOtherClients()
{
m_otherClients.clear();
}
void CAirspaceMonitor::ps_receivedBookings(const CAtcStationList &bookedStations) void CAirspaceMonitor::ps_receivedBookings(const CAtcStationList &bookedStations)
{ {
Q_ASSERT(BlackCore::isCurrentThreadCreatingThread(this)); Q_ASSERT(BlackCore::isCurrentThreadCreatingThread(this));

View File

@@ -112,10 +112,9 @@ namespace BlackCore
//! Clear the contents //! Clear the contents
void clear() void clear()
{ {
m_atcStationsOnline.clear(); removeAllAtcStations();
m_atcStationsBooked.clear(); removeAllAircrafts();
m_aircraftsInRange.clear(); removeAllOtherClients();
m_otherClients.clear();
m_metarCache.clear(); m_metarCache.clear();
m_flightPlanCache.clear(); m_flightPlanCache.clear();
} }
@@ -145,6 +144,10 @@ namespace BlackCore
//! Helper method, add voice capabilites if available //! Helper method, add voice capabilites if available
void addVoiceCapabilitiesFromDataFile(BlackMisc::CPropertyIndexVariantMap &vm, const BlackMisc::Aviation::CCallsign &callsign); void addVoiceCapabilitiesFromDataFile(BlackMisc::CPropertyIndexVariantMap &vm, const BlackMisc::Aviation::CCallsign &callsign);
void removeAllAtcStations();
void removeAllAircrafts();
void removeAllOtherClients();
private slots: private slots:
void ps_realNameReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &realname); void ps_realNameReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &realname);
void ps_capabilitiesReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, quint32 flags); void ps_capabilitiesReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, quint32 flags);