From 82170579ad917c3ce328131dff24018123a34d6a Mon Sep 17 00:00:00 2001 From: Stefan Fuchs Date: Mon, 11 Dec 2017 21:40:06 +0100 Subject: Enable removal of pictures from different dives at the same moment Suggested-by: Berthold Stoeger Signed-off-by: Stefan Fuchs --- core/dive.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'core/dive.c') diff --git a/core/dive.c b/core/dive.c index d990f6a2f..4b103bfbd 100644 --- a/core/dive.c +++ b/core/dive.c @@ -3838,9 +3838,10 @@ struct picture *clone_picture(struct picture *src) return dst; } -void dive_remove_picture(char *filename) +// Return true if picture was found and deleted +bool dive_remove_picture(struct dive *d, char *filename) { - struct picture **picture = ¤t_dive->picture_list; + struct picture **picture = &d->picture_list; while (*picture && !same_string((*picture)->filename, filename)) picture = &(*picture)->next; if (*picture) { @@ -3848,7 +3849,9 @@ void dive_remove_picture(char *filename) picture_free(*picture); *picture = temp; invalidate_dive_cache(current_dive); + return true; } + return false; } /* this always acts on the current divecomputer of the current dive */ -- cgit v1.2.3-70-g09d2