summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop-widgets/divelistview.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp
index a34d78e5c..6cb4a81c3 100644
--- a/desktop-widgets/divelistview.cpp
+++ b/desktop-widgets/divelistview.cpp
@@ -555,10 +555,10 @@ void DiveListView::selectionChangeDone()
// by the selected dives.
if (!DiveFilter::instance()->diveSiteMode()) {
QVector<dive_site *> selectedSites;
- for (QModelIndex index: selectionModel()->selection().indexes()) {
+ for (QModelIndex index: selectionModel()->selectedRows()) {
const QAbstractItemModel *model = index.model();
struct dive *dive = model->data(index, DiveTripModelBase::DIVE_ROLE).value<struct dive *>();
- if (dive && dive->dive_site)
+ if (dive && dive->dive_site && !selectedSites.contains(dive->dive_site))
selectedSites.push_back(dive->dive_site);
}
MapWidget::instance()->setSelected(selectedSites);