diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-09-01 17:52:25 +0200 |
---|---|---|
committer | Robert C. Helling <helling@atdotde.de> | 2019-09-10 21:31:21 +0200 |
commit | 4706b0f11ae335c1d23e1334b3530fce1a2c9279 (patch) | |
tree | ca1cf3663b5ae590d1b191648d02fc1c25ff2fcf /core/planner.h | |
parent | 8ac48a96c75bae4fc9dbd5f0c434d6144a8b8502 (diff) | |
download | subsurface-4706b0f11ae335c1d23e1334b3530fce1a2c9279.tar.gz |
Planner: remove planner disclaimer from old notes
There used to be code to remove the old planner notes when replanning
a dive. It used a global variable and seemed rather brittle. Moreover,
the place that set the global variable was inadvertently removed.
Therefore has been effectively dead code.
Reimplement the functionality, but be more robust by considering
that the deco-type may have changed: Split the translated disclaimer
string in two parts, before and after the "%s" place-holder.
Search for these two parts. Remove the disclaimer and everything
after the disclaimer.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/planner.h')
-rw-r--r-- | core/planner.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/planner.h b/core/planner.h index 404fbe3fc..156d39983 100644 --- a/core/planner.h +++ b/core/planner.h @@ -50,6 +50,7 @@ extern int get_cylinderid_at_time(struct dive *dive, struct divecomputer *dc, du extern int get_gasidx(struct dive *dive, struct gasmix mix); extern bool diveplan_empty(struct diveplan *diveplan); extern void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_disclaimer, int error); +extern const char *get_planner_disclaimer(); extern void free_dps(struct diveplan *diveplan); extern struct dive *planned_dive; |