From 488eb1542336088245841d79549e26938e2d3fd9 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 30 Aug 2019 17:38:54 +0200 Subject: 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 --- qt-models/maplocationmodel.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'qt-models/maplocationmodel.cpp') diff --git a/qt-models/maplocationmodel.cpp b/qt-models/maplocationmodel.cpp index ea7d4f098..10d983575 100644 --- a/qt-models/maplocationmodel.cpp +++ b/qt-models/maplocationmodel.cpp @@ -229,6 +229,11 @@ void MapLocationModel::setSelected(struct dive_site *ds) m_selectedDs.append(ds); } +void MapLocationModel::setSelected(const QVector &divesites) +{ + m_selectedDs = divesites; +} + bool MapLocationModel::isSelected(const QVariant &dsVariant) const { dive_site *ds = dsVariant.value(); -- cgit v1.2.3-70-g09d2