From 4d937051ca4390874f741c1a313fccf622cffcd3 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 5 Jun 2013 17:15:32 +0900 Subject: Fixing some issues with the dive selection after OK on preferences These changes should be correct - but they still don't fix the problem that after we click 'OK' on the preferences (regardless of whether any changes were made), the first dive is set as current dive and shown in the map window. Signed-off-by: Dirk Hohndel --- qt-ui/divelistview.cpp | 2 +- qt-ui/mainwindow.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index b75dda1f5..97daff88f 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -157,7 +157,7 @@ void DiveListView::reload(DiveTripModel::Layout layout, bool forceSort) sortByColumn(0, Qt::DescendingOrder); if (amount_selected && selected_dive >= 0) { - // magic happens and the selected dive is expanded and scrolled to + selectDive(current_dive, true); } else { QModelIndex firstDiveOrTrip = m->index(0,0); if (firstDiveOrTrip.isValid()) { diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index dbf3b9c73..3c550439b 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -58,7 +58,7 @@ MainWindow::MainWindow() : ui(new Ui::MainWindow()), helpView(0) // this gets called after we download dives from a divecomputer void MainWindow::refreshDisplay() { - if (!selected_dive) + if (selected_dive == -1) current_dive_changed(dive_table.nr - 1); ui->ListWidget->reload(); } -- cgit v1.2.3-70-g09d2