From cc91cad89091d0212cc09e840dfde513b968f7b7 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 27 Nov 2013 08:39:47 -0800 Subject: Make sure we keep our notion of what's selected in sync with the UI When editing a dive, a group of dives or a trip we need to make sure that we don't lose track of which dives and trips were selected. Otherwise we might act on dives that DON'T appear selected in the UI but that we think are still selected. Fixes #304 Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'qt-ui') diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 11d764abe..8c0f6849a 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -549,8 +549,10 @@ void MainTab::acceptChanges() // now comes the scary moment... we need to re-sort dive table in case this dive wasn't the last // so now all pointers become invalid // fingers crossed that we aren't holding on to anything here + mainWindow()->dive_list()->rememberSelection(); sort_table(&dive_table); mainWindow()->refreshDisplay(); + mainWindow()->dive_list()->restoreSelection(); } void MainTab::resetPallete() -- cgit v1.2.3-70-g09d2