Keep edited profile after editing a manually added dive

This is yet another unintended side effect of the UI restructure changes.
I stared at this code for so long - I can't believe I kept missing this.

Fixes #668

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-07-31 14:41:30 -07:00
parent e32bdad8e9
commit 13d922aef7

View file

@ -664,6 +664,11 @@ void MainTab::acceptChanges()
currentTrip = NULL;
ui.dateEdit->setEnabled(true);
} else {
if (editMode == MANUALLY_ADDED_DIVE) {
// preserve any changes to the profile
free(current_dive->dc.sample);
copy_samples(&displayed_dive.dc, &current_dive->dc);
}
struct dive *cd = current_dive;
//Reset coordinates field, in case it contains garbage.
updateGpsCoordinates(&displayed_dive);