From 79f3000630d62ccd242b2edca1b4dd412bc5a74b Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Thu, 2 May 2019 22:22:52 +0200 Subject: Map: don't set map selection in selectVisibleLocations() MapWidgetHelper::selectVisibleLocations() calls setSelection() on a single dive. Firstly, this make no sense anymore, as we now support multiple highlithed flags. Secondly, the highlted dives are now derived from the selected dives. Therefore, remove the call. Signed-off-by: Berthold Stoeger --- map-widget/qmlmapwidgethelper.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'map-widget/qmlmapwidgethelper.cpp') diff --git a/map-widget/qmlmapwidgethelper.cpp b/map-widget/qmlmapwidgethelper.cpp index 57ad01ad5..5454f5858 100644 --- a/map-widget/qmlmapwidgethelper.cpp +++ b/map-widget/qmlmapwidgethelper.cpp @@ -141,7 +141,6 @@ void MapWidgetHelper::selectVisibleLocations() { int idx; struct dive *dive; - bool selectedFirst = false; m_selectedDiveIds.clear(); for_each_dive (idx, dive) { struct dive_site *ds = get_dive_site_for_dive(dive); @@ -153,18 +152,12 @@ void MapWidgetHelper::selectVisibleLocations() QPointF point; QMetaObject::invokeMethod(m_map, "fromCoordinate", Q_RETURN_ARG(QPointF, point), Q_ARG(QGeoCoordinate, dsCoord)); - if (!qIsNaN(point.x())) { - if (!selectedFirst) { - m_mapLocationModel->setSelected(ds, false); - selectedFirst = true; - } + if (!qIsNaN(point.x())) #ifndef SUBSURFACE_MOBILE // indexes on desktop m_selectedDiveIds.append(idx); - } } #else // use id on mobile instead of index m_selectedDiveIds.append(dive->id); - } } int last; // get latest dive chronologically if (!m_selectedDiveIds.isEmpty()) { -- cgit v1.2.3-70-g09d2