summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-04-23 15:24:02 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-04-23 15:27:21 -0700
commit415abeea66d180da05bdb5ad31439d6f937d7168 (patch)
tree663de2cf3b3d0cc0c9de0866dbcec6d06bbc6cf7 /dive.h
parentbbfa2b655bac88306f8e7805f2eb61b2f801ad0a (diff)
downloadsubsurface-415abeea66d180da05bdb5ad31439d6f937d7168.tar.gz
When deleting a cylinder, adapt gas changes
When we delete a cylinder the gas changes in that dive may have to be adjusted. We didn't do this at all in the past. With this commit we should be doing this right for a single dive that is being edited. This does NOT handle multiple dives being edited at the same time (or more specifically - if you have multiple dives selected and delete a cylinder, the dives that had the same set of cylinders (other than the displayed dive) will get that particular cylinder deleted, but won't have their gas change events (and sensor data in the samples) adapted. Possibly we should simply prohibit deleting cylinders when more than one dive are selected. See #834 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/dive.h b/dive.h
index af4eb0d38..c50fb1a91 100644
--- a/dive.h
+++ b/dive.h
@@ -349,6 +349,7 @@ struct dive {
};
extern int get_cylinder_idx_by_use(struct dive *dive, enum cylinderuse cylinder_use_type);
+extern void dc_cylinder_renumber(struct dive *dive, struct divecomputer *dc, int mapping[]);
/* when selectively copying dive information, which parts should be copied? */
struct dive_components {
@@ -721,6 +722,7 @@ extern struct dive *merge_dives(struct dive *a, struct dive *b, int offset, bool
extern struct dive *try_to_merge(struct dive *a, struct dive *b, bool prefer_downloaded);
extern void renumber_dives(int start_nr, bool selected_only);
extern void copy_events(struct divecomputer *s, struct divecomputer *d);
+extern void free_events(struct event *ev);
extern void copy_cylinders(struct dive *s, struct dive *d, bool used_only);
extern void copy_samples(struct divecomputer *s, struct divecomputer *d);
extern bool is_cylinder_used(struct dive *dive, int idx);