Desktop: show all selected dive sites on click

When clicking a dive site on the map, the QML code would set
the selected dive site, but then all dives of dive sites in
the vicinity were set. But still only the clicked-on dive site
was shown.

Therefore, don't set the list of selected dive sites in QML,
but later in DiveListView::selectDives(), where we know all
the dives that were selected.

This, again, gives nasty entanglement of diverse widgets and
models.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-08-30 17:38:54 +02:00 committed by Dirk Hohndel
parent b39f2406c6
commit 488eb15423
8 changed files with 38 additions and 3 deletions

View file

@ -46,6 +46,11 @@ void MapWidgetHelper::centerOnDiveSite(struct dive_site *ds)
}
}
void MapWidgetHelper::setSelected(const QVector<dive_site *> &divesites)
{
m_mapLocationModel->setSelected(divesites);
}
void MapWidgetHelper::centerOnSelectedDiveSite()
{
QVector<struct dive_site *> selDS = m_mapLocationModel->selectedDs();
@ -115,6 +120,7 @@ void MapWidgetHelper::reloadMapLocations()
void MapWidgetHelper::selectionChanged()
{
updateEditMode();
m_mapLocationModel->selectionChanged();
}