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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-11-27 08:39:47 -08:00
parent 3fd39a7a87
commit cc91cad890

View file

@ -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()