Select the correct dive in EditAddedDive mode

If we added two dives, and then tried to edit
the first added one, the current 'added dive'
set on main_tab would be the second one, so when
we got to the accept() part of the call, it would
reselect the last added_dive that we had.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-06-07 10:29:17 -03:00 committed by Dirk Hohndel
parent 09172ddfa4
commit d9801b67b4

View file

@ -800,6 +800,7 @@ void MainTab::acceptChanges()
// preserve any changes to the profile
free(current_dive->dc.sample);
copy_samples(&displayed_dive.dc, &current_dive->dc);
addedId = displayed_dive.id;
}
struct dive *cd = current_dive;
// now check if something has changed and if yes, edit the selected dives that