summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2015-05-08 23:16:55 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-05-09 06:54:03 -0700
commit412844c02b5180e67337de2404629163d0434574 (patch)
tree249763409e17079c1ab5aca7ad286d303bdb65e7
parente5383474246335fb21b16195ba30cfa2a2a42c80 (diff)
downloadsubsurface-412844c02b5180e67337de2404629163d0434574.tar.gz
Keep old notes when saving as new dive in replan
... but discard an old disclaimer and runtime table if present. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/diveplanner.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 42570dac6..aacca8e8f 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -1328,6 +1328,11 @@ void DivePlannerPointsModel::createPlan(bool replanCopy)
if (current_dive->divetrip)
add_dive_to_trip(copy, current_dive->divetrip);
record_dive(copy);
+ QString oldnotes(current_dive->notes);
+ if (oldnotes.indexOf(QString(disclaimer)) >= 0)
+ oldnotes.truncate(oldnotes.indexOf(QString(disclaimer)));
+ oldnotes.append(displayed_dive.notes);
+ displayed_dive.notes = strdup(oldnotes.toUtf8().data());
}
copy_dive(&displayed_dive, current_dive);
}