summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mapwidget.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-05-03 22:17:03 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-05-11 12:06:19 -0700
commit403206ca06cf87d64b75cafa8629956ea7cf282b (patch)
tree59a1d29131fe43ff369a38c0c95178070e892c45 /desktop-widgets/mapwidget.cpp
parent8eb586d1d4b5de9433239cda9a9462ba5a250058 (diff)
downloadsubsurface-403206ca06cf87d64b75cafa8629956ea7cf282b.tar.gz
Selection: automatically unselect old selection in selectDives()
DiveListView::selectDives() would only select new dives but not clear the old selection. Thus, callers would have to clear the selection first. That would lead to two selection-changed signals. Move the unselectDives() call into DiveListView::selectDives(). The DiveListView has an internal flag to prevent double signals. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/mapwidget.cpp')
-rw-r--r--desktop-widgets/mapwidget.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/desktop-widgets/mapwidget.cpp b/desktop-widgets/mapwidget.cpp
index 81f9f9419..11e6425b1 100644
--- a/desktop-widgets/mapwidget.cpp
+++ b/desktop-widgets/mapwidget.cpp
@@ -105,11 +105,7 @@ void MapWidget::prepareForGetDiveCoordinates(struct dive_site *ds)
void MapWidget::selectedDivesChanged(const QList<int> &list)
{
CHECK_IS_READY_RETURN_VOID();
- skipReload = true;
- MainWindow::instance()->diveList->unselectDives();
- if (!list.empty())
- MainWindow::instance()->diveList->selectDives(list);
- skipReload = false;
+ MainWindow::instance()->diveList->selectDives(list);
}
void MapWidget::coordinatesChanged(struct dive_site *ds, const location_t &location)