summaryrefslogtreecommitdiffstats
path: root/core/dive.c
diff options
context:
space:
mode:
authorGravatar Stefan Fuchs <sfuchs@gmx.de>2017-12-11 21:40:06 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-12-13 05:48:20 -0800
commit82170579ad917c3ce328131dff24018123a34d6a (patch)
tree34b23ebfb1671ced7edf8f5d975a25be81f6c7aa /core/dive.c
parent7bc77947f6ab37d0d557cc237ab0ecceb2ecbe64 (diff)
downloadsubsurface-82170579ad917c3ce328131dff24018123a34d6a.tar.gz
Enable removal of pictures from different dives at the same moment
Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Diffstat (limited to 'core/dive.c')
-rw-r--r--core/dive.c7
1 files changed, 5 insertions, 2 deletions
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 = &current_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 */