diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-07-20 20:26:06 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-11 16:22:27 -0700 |
commit | 302f6adb79681da3fe53336f1e4c7525f46fd47d (patch) | |
tree | ce752cf002ec01cd9c26a804e49b2ee5b516d6ac /core/dive.h | |
parent | 12df9faaa2037b5155ebb84a7f6f6102491a0091 (diff) | |
download | subsurface-302f6adb79681da3fe53336f1e4c7525f46fd47d.tar.gz |
Undo: implement rudimentary support for undo of dive-splitting
For this, the core functionality of the split_dive() and
split_dive_at_time() functions were split out into new
split_dive_dont_insert() and split_dive_at_time_dont_insert(),
which do not add the new dives to the log. Thus, the undo-command
can take ownership of these dives, without having to remove them
first.
The split-dive functionality is temporarily made desktop-only
until mobile also supports "UndoObjects".
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/dive.h')
-rw-r--r-- | core/dive.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/dive.h b/core/dive.h index 2d3edbc5c..340bc7ec8 100644 --- a/core/dive.h +++ b/core/dive.h @@ -569,7 +569,9 @@ extern void fixup_dc_duration(struct divecomputer *dc); extern int dive_getUniqID(); extern unsigned int dc_airtemp(const struct divecomputer *dc); extern unsigned int dc_watertemp(const struct divecomputer *dc); -extern int split_dive(struct dive *); +extern int split_dive_dont_insert(const struct dive *dive, struct dive **new1, struct dive **new2); +extern void split_dive(struct dive *); +extern int split_dive_at_time_dont_insert(const struct dive *dive, duration_t time, struct dive **new1, struct dive **new2); extern void split_dive_at_time(struct dive *dive, duration_t time); extern struct dive *merge_dives(struct dive *a, struct dive *b, int offset, bool prefer_downloaded); extern struct dive *try_to_merge(struct dive *a, struct dive *b, bool prefer_downloaded); |