diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-11-08 17:13:17 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-11-18 16:50:09 -0800 |
commit | 0618aa737fde54e634d16273ec0246ced9c454aa (patch) | |
tree | 0ebcb45cb2c3849d5b78fc979e9984380485a9a3 /core/dive.h | |
parent | c48056300d61987850dbe9ad92b20a293d03dc75 (diff) | |
download | subsurface-0618aa737fde54e634d16273ec0246ced9c454aa.tar.gz |
Core: unify insert_trip() and insert_trip_dont_merge()
There were two versions of the insert_trip() function: one
would merge trips if a trip with the same date already existed,
the other wouldn't. The latter was introduced with the dive-list
undo work.
The problem is that the "date" of a trip (i.e. the first dive)
seems ill-defined as this is a volatile value. Moreover in
the context of making dive-import undoable this is a very
dangerous notion, as the caller needs control over when the dives
are added to a trip.
Therefore, unify these two functions and never merge trips.
The decision on merging dives now has to made by the caller.
This will be implemented in a future commit.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/dive.h')
-rw-r--r-- | core/dive.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/core/dive.h b/core/dive.h index 7e4336317..aa37eeb46 100644 --- a/core/dive.h +++ b/core/dive.h @@ -421,8 +421,7 @@ extern void delete_single_dive(int idx); extern int dive_get_insertion_index(struct dive *dive); extern void add_single_dive(int idx, struct dive *dive); -extern void insert_trip(dive_trip_t **trip); -extern void insert_trip_dont_merge(dive_trip_t *trip); +extern void insert_trip(dive_trip_t *trip); extern void unregister_trip(dive_trip_t *trip); extern void free_trip(dive_trip_t *trip); |