Remove satellites from map on close

pull/1600/head
Jon Beniston 2023-02-16 14:33:39 +00:00
rodzic 9fb1171336
commit 4fa132731b
1 zmienionych plików z 16 dodań i 0 usunięć

Wyświetl plik

@ -68,6 +68,16 @@ SatelliteTrackerWorker::~SatelliteTrackerWorker()
qDebug() << "SatelliteTrackerWorker::~SatelliteTrackerWorker";
stopWork();
m_inputMessageQueue.clear();
// Remove satellites from Map
QHashIterator<QString, SatWorkerState *> itr(m_workerState);
while (itr.hasNext())
{
itr.next();
if (m_settings.m_drawOnMap) {
removeFromMap(itr.key());
}
}
qDeleteAll(m_workerState);
}
void SatelliteTrackerWorker::startWork()
@ -187,7 +197,13 @@ void SatelliteTrackerWorker::applySettings(const SatelliteTrackerSettings& setti
{
itr.next();
if (settings.m_satellites.indexOf(itr.key()) == -1)
{
if (m_settings.m_drawOnMap) {
removeFromMap(itr.key());
}
delete itr.value();
itr.remove();
}
}
// Add new satellites