planner: update UI after having saved the dive

The UI was updated before storing the dive. This had a nasty
effect: the current dive was shown in the profile and if that
was a manually added dive, the DivePlannerPointsModel was
overwritten. Thus the planned dive couldn't be saved anymore.

There is a comment why the UI switch was done beforehand.
But in my tests, this didn't seem to be valid anymore.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-03-12 15:02:34 +01:00
parent 1fbdc387c8
commit 357e115121

View file

@ -1338,8 +1338,6 @@ void DivePlannerPointsModel::createPlan(bool replanCopy)
}
setPlanMode(NOTHING);
planCreated(); // This signal will exit the profile from planner state. This must be *before* adding the dive,
// so that the Undo-commands update the display accordingly (see condition in updateDiveInfo().
// Now, add or modify the dive.
if (!current_dive || d->id != current_dive->id) {
@ -1367,4 +1365,6 @@ void DivePlannerPointsModel::createPlan(bool replanCopy)
// Remove and clean the diveplan, so we don't delete
// the dive by mistake.
free_dps(&diveplan);
planCreated(); // This signal will exit the UI from planner state.
}