aboutsummaryrefslogtreecommitdiffstats
path: root/map-widget/qmlmapwidgethelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'map-widget/qmlmapwidgethelper.cpp')
-rw-r--r--map-widget/qmlmapwidgethelper.cpp16
1 files changed, 1 insertions, 15 deletions
diff --git a/map-widget/qmlmapwidgethelper.cpp b/map-widget/qmlmapwidgethelper.cpp
index 6f5f1804e..a7ef00bf8 100644
--- a/map-widget/qmlmapwidgethelper.cpp
+++ b/map-widget/qmlmapwidgethelper.cpp
@@ -47,23 +47,9 @@ void MapWidgetHelper::centerOnDiveSite(struct dive_site *ds)
void MapWidgetHelper::centerOnSelectedDiveSite()
{
- QVector<struct dive_site *> selDS;
+ QVector<struct dive_site *> selDS = m_mapLocationModel->selectedDs();
QVector<QGeoCoordinate> selGC;
- int idx;
- struct dive *dive;
- for_each_dive (idx, dive) {
- if (!dive->selected)
- continue;
- struct dive_site *dss = get_dive_site_for_dive(dive);
- if (!dive_site_has_gps_location(dss))
- continue;
- // only store dive sites with GPS
- selDS.append(dss);
- selGC.append(QGeoCoordinate(dss->location.lat.udeg * 0.000001,
- dss->location.lon.udeg * 0.000001));
- }
-
if (selDS.isEmpty()) {
// no selected dives with GPS coordinates
QMetaObject::invokeMethod(m_map, "deselectMapLocation");