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 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(); - 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);