diff options
Diffstat (limited to 'desktop-widgets/divelistview.cpp')
-rw-r--r-- | desktop-widgets/divelistview.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp index 19eeccb13..489929bc6 100644 --- a/desktop-widgets/divelistview.cpp +++ b/desktop-widgets/divelistview.cpp @@ -27,6 +27,7 @@ #include "qt-models/divepicturemodel.h" #include "core/metrics.h" #include "desktop-widgets/simplewidgets.h" +#include "desktop-widgets/mapwidget.h" DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelection(false), currentLayout(DiveTripModelBase::TREE), dontEmitDiveChangedSignal(false), selectionSaved(false), @@ -455,6 +456,22 @@ void DiveListView::selectDives(const QList<int> &newDiveSelection) scrollTo(idx.parent()); scrollTo(idx); } + + // update the selected-flag for the dive sites. + // the actual reloading of the dive sites will be perfomed + // by the main-window in response to the divesSelected signal + // emitted below. + QVector<dive_site *> selectedSites; + for (int idx: newDiveSelection) { + dive *d = get_dive(idx); + if (!d) + continue; + dive_site *ds = d->dive_site; + if (ds && !selectedSites.contains(ds)) + selectedSites.append(ds); + } + MapWidget::instance()->setSelected(selectedSites); + // now that everything is up to date, update the widgets emit divesSelected(); dontEmitDiveChangedSignal = false; |