diff options
author | Robert C. Helling <helling@atdotde.de> | 2017-03-27 18:30:05 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-03-28 13:31:45 -0700 |
commit | eefa390e5f53e3124f996124c25c487da5f008ca (patch) | |
tree | 117a31179256f1a8f041870dce503fb2c8d9b591 /qt-models | |
parent | 622ab2286abf23de889b928cdde4b4e234b76fc3 (diff) | |
download | subsurface-eefa390e5f53e3124f996124c25c487da5f008ca.tar.gz |
Handle notes in replan
Upon replanning a dive, we want to delete the old
dive plan in the notes and replace it with the actual.
This fixes a problem when we failed to detect the old plan due
to the deco model name appearing in the disclaimer that was used
as a marker for the notes.
This patch also adds translation markers for the deco model name strings..
Fixes #285
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'qt-models')
-rw-r--r-- | qt-models/diveplannermodel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 26e4fc1ba..c35471a44 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -894,8 +894,8 @@ void DivePlannerPointsModel::createPlan(bool replanCopy) 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))); + if (oldnotes.indexOf(QString(disclaimer).left(40)) >= 0) + oldnotes.truncate(oldnotes.indexOf(QString(displayed_dive.notes).left(40))); if (did_deco) oldnotes.append(displayed_dive.notes); displayed_dive.notes = strdup(oldnotes.toUtf8().data()); |