diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/gpslocation.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/core/gpslocation.cpp b/core/gpslocation.cpp index 2d65ae211..9db829b02 100644 --- a/core/gpslocation.cpp +++ b/core/gpslocation.cpp @@ -436,13 +436,12 @@ void GpsLocation::deleteFixFromStorage(gpsTracker >) void GpsLocation::deleteGpsFix(qint64 when) { - struct gpsTracker defaultTracker; - defaultTracker.when = 0; - struct gpsTracker deletedTracker = m_trackers.value(when, defaultTracker); - if (deletedTracker.when != when) { - qDebug() << "can't find tracker for timestamp" << when; + auto it = m_trackers.find(when); + if (it == m_trackers.end()) { + qWarning() << "GpsLocation::deleteGpsFix(): can't find tracker for timestamp " << when; return; } + struct gpsTracker deletedTracker = *it; deleteFixFromStorage(deletedTracker); m_deletedTrackers.append(deletedTracker); } |