Fix wrong handling of Dive Table, and revert some wrong changes.

This patch just reverts some wrong changes that I'v done on a
past commit ( sorry ) and correctly handles the selectDive,
by using a IDX instead of the dive pointer, as dirk told me
it's extremely error-prone since the pointer can change.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2013-11-16 18:41:47 -02:00 committed by Dirk Hohndel
parent c1a05fd034
commit 4f9526ef81
6 changed files with 32 additions and 74 deletions

View file

@ -511,7 +511,7 @@ void MainTab::acceptChanges()
// unselectDives() doesn't mess with the dive_table at all
struct dive *addedDive = current_dive;
mainWindow()->dive_list()->unselectDives();
mainWindow()->dive_list()->selectDive(addedDive, true, true);
mainWindow()->dive_list()->selectDive(selected_dive, true, true);
mainWindow()->showProfile();
mark_divelist_changed(TRUE);
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::NOTHING);