From 357e11512108a68da7cf9f7f2d7da77f5661f138 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 12 Mar 2022 15:02:34 +0100 Subject: [PATCH] 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 --- qt-models/diveplannermodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 5b2db708f..b952202d3 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -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. }