aboutsummaryrefslogtreecommitdiffstats
path: root/map-widget
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-05-02 22:22:52 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-05-11 12:06:19 -0700
commit79f3000630d62ccd242b2edca1b4dd412bc5a74b (patch)
treeaed9ab4181acecb2b55531f260792b96193fed62 /map-widget
parent7c99b3a76fc2d257b5d89f271154cf4b91574d0c (diff)
downloadsubsurface-79f3000630d62ccd242b2edca1b4dd412bc5a74b.tar.gz
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'map-widget')
-rw-r--r--map-widget/qmlmapwidgethelper.cpp9
1 files changed, 1 insertions, 8 deletions
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()) {