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>
This commit is contained in:
Berthold Stoeger 2019-05-02 22:22:52 +02:00 committed by Dirk Hohndel
parent 7c99b3a76f
commit 79f3000630

View file

@ -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()) {