From 4583cd8e09944e61aa59baa58e74abee0af0d268 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 5 Aug 2014 12:37:14 -0700 Subject: Picture handling: cleaning up the mess We had pointers to data structures on the stack which we frequently reallocated. These data structure contain basically a filename and an offset. We then create a hash of the pointers to those datastructures with the filename being the key. And then we passed those pointers around through a Qt model(!!!) only in order to then later look up by filename what the offset might be. I am at a loss for words for the lunacy behind this design. How about we just remember the offsets and pass the integers around? Signed-off-by: Dirk Hohndel --- dive.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dive.h') diff --git a/dive.h b/dive.h index 3ca305ff0..7cd67fa27 100644 --- a/dive.h +++ b/dive.h @@ -311,7 +311,7 @@ struct picture { extern struct picture *alloc_picture(); extern void dive_create_picture(struct dive *d, char *filename, int shift_time); extern void dive_add_picture(struct dive *d, struct picture *newpic); -extern void dive_remove_picture(struct picture *pic); +extern void dive_remove_picture(char *filename); extern unsigned int dive_get_picture_count(struct dive *d); extern void picture_load_exif_data(struct picture *p, timestamp_t *timestamp); extern void dive_set_geodata_from_picture(struct dive *d, struct picture *pic); -- cgit v1.2.3-70-g09d2