summaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-19 15:03:53 -0500
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-19 21:17:52 -0500
commita85a219df3250e9a4c4336ea4b6f4a59f4ee9963 (patch)
treef3fb6dbf29a50db233489127b04e7eb6938e99ad /qt-ui/diveplanner.cpp
parent76f3c0f028b2eb83fb8cc01cd60488f79752b799 (diff)
downloadsubsurface-a85a219df3250e9a4c4336ea4b6f4a59f4ee9963.tar.gz
Add ability to replan a dive that we planned before
When doing this, all waypoints of the calculated ascent are now waypoints in the plan - so the user has to remove the ascent part of the dive in order to really replan the dive. That's a pain, but we don't keep the data around that would tell us which waypoints are user input and which ones were calculated. Fixes #527 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index b5fee2970..8775196b7 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -1155,7 +1155,9 @@ void DivePlannerPointsModel::createPlan()
//TODO: C-based function here?
plan(&diveplan, &cache, isPlanner(), true);
- record_dive(clone_dive(&displayed_dive));
+ 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));
mark_divelist_changed(true);
// Remove and clean the diveplan, so we don't delete