diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-05-24 13:55:18 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-05-24 13:58:13 -0700 |
commit | 10e567515161f23510874236efd2f105c033ecec (patch) | |
tree | 7f0a8e2df82f3683ab3034208405d28efba95c78 /qt-ui | |
parent | dbb86374e00df9e06c4d96c436e3c3a998cc1ae9 (diff) | |
download | subsurface-10e567515161f23510874236efd2f105c033ecec.tar.gz |
Dive list: work around odd problem with selections
According to the documentation clearSelection() should emit
selectionChanged() - but I can verify in the debugger that sometimes this
doesn't appear to happen - consequently our notion of what's selected gets
confused.
To work around this, after calling clearSelection() we simply manuall
deselect all dives.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/divelistview.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index 91b3dadf5..1f716ed57 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -190,8 +190,13 @@ void DiveListView::selectTrip(dive_trip_t *trip) void DiveListView::unselectDives() { selectionModel()->clearSelection(); - if (amount_selected != 0) - qDebug() << "selection information inconsistent"; + // clearSelection should emit selectionChanged() but sometimes that + // appears not to happen + int i; + struct dive *dive; + for_each_dive(i, dive) { + deselect_dive(i); + } } QList<dive_trip_t *> DiveListView::selectedTrips() |