summaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index b8ca2fb27..d490de3b4 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -1179,9 +1179,15 @@ void DivePlannerPointsModel::createPlan()
//TODO: C-based function here?
plan(&diveplan, &cache, isPlanner(), true);
- if (!current_dive || displayed_dive.id != current_dive->id)
+ if (!current_dive || displayed_dive.id != current_dive->id) {
// we were planning a new dive, not re-planning an existing on
record_dive(clone_dive(&displayed_dive));
+ } else if (current_dive && displayed_dive.id == current_dive->id) {
+ // we are replanning a dive - make sure changes are reflected
+ // correctly in the dive structure and copy it back into the dive table
+ fixup_dive(&displayed_dive);
+ copy_dive(&displayed_dive, current_dive);
+ }
mark_divelist_changed(true);
// Remove and clean the diveplan, so we don't delete