diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-09-23 21:22:48 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-11 16:22:27 -0700 |
commit | f427226b3b605523bc8285dbdaaa7f6993af6e6a (patch) | |
tree | e025722f92883fbac72b3584d6b4fb301bb8a40d /core/load-git.c | |
parent | 4fbb8ef399a356e0b1a7393311c22ca68c50a14d (diff) | |
download | subsurface-f427226b3b605523bc8285dbdaaa7f6993af6e6a.tar.gz |
Undo: make diverse trip-related operations undo-able
AddDivesToTrip, CreateTrip, AutogroupDives, RemoveAutogenTrips
and MergeTrips basically all did the same thing as RemoveDivesFromTrip,
which was already implemented. Thus, factor our the common functionality
and hook it up to make all these functions undo-able.
Don't do the autogroup-call everytime the dive-list is rebuilt
(that would create innumberable undo-actions), but only on dive-load /
import or if expressly asked by the user [by switching the autogroup
flag].
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/load-git.c')
-rw-r--r-- | core/load-git.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/load-git.c b/core/load-git.c index 66f4fd531..0abae4239 100644 --- a/core/load-git.c +++ b/core/load-git.c @@ -1208,7 +1208,7 @@ static struct dive *create_new_dive(timestamp_t when) static dive_trip_t *create_new_trip(int yyyy, int mm, int dd) { - dive_trip_t *trip = calloc(1, sizeof(dive_trip_t)); + dive_trip_t *trip = alloc_trip(); struct tm tm = { 0 }; /* We'll fill in the real data from the trip descriptor file */ |