From e88a9aa83eacaa6a003ca440947fa20c9b598834 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 31 May 2013 21:05:33 +0900 Subject: Once again try to fix the selection Things got broken. Again. We no longer kept track of the selected dives in our structures which broke statistics. This attempts to fix that, but appears to still have a bug when selecting trips. Sometimes this results in 0 dives being selected according to our data structures, while Qt happily shows all dives of the trip as seected. Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'qt-ui/mainwindow.cpp') diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index d3cd951d8..5a33bd4d5 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -63,9 +63,11 @@ void MainWindow::refreshDisplay() void MainWindow::current_dive_changed(int divenr) { - select_dive(divenr); - ui->globe->centerOn(get_dive(selected_dive)); - redrawProfile(); + if (amount_selected && divenr >= 0) { + select_dive(divenr); + ui->globe->centerOn(get_dive(selected_dive)); + redrawProfile(); + } ui->InfoWidget->updateDiveInfo(divenr); } -- cgit v1.2.3-70-g09d2