From f6f2c4e929fd6da77c83b50f60720f3c04c8c107 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 21 Jul 2014 20:44:46 -0300 Subject: Only repopulate the dive info once ( we were repopulating 4 times ) This makes the screen repopulate itself after a dive change only one time instead of the old 4. we were repopulateing when we removed the actual selection to reset the old selection previously stored, sigh. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/divelistview.cpp | 2 ++ qt-ui/maintab.cpp | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index 5fde4c45f..442ea1fb7 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -156,7 +156,9 @@ void DiveListView::restoreSelection() return; selectionSaved = false; + dontEmitDiveChangedSignal = true; unselectDives(); + dontEmitDiveChangedSignal = false; Q_FOREACH (dive_trip_t *trip, selectedDives.keys()) { QList divesOnTrip = getDivesInTrip(trip); QList selectedDivesOnTrip = selectedDives.values(trip); diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 87d2a1beb..95143ed11 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -761,10 +761,9 @@ void MainTab::acceptChanges() editMode = NONE; MainWindow::instance()->dive_list()->rememberSelection(); sort_table(&dive_table); - MainWindow::instance()->refreshDisplay(); + MainWindow::instance()->refreshDisplay(false); MainWindow::instance()->dive_list()->restoreSelection(); } - updateDiveInfo(); DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::NOTHING); MainWindow::instance()->dive_list()->verticalScrollBar()->setSliderPosition(scrolledBy); MainWindow::instance()->dive_list()->setFocus(); -- cgit v1.2.3-70-g09d2