mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive media: on import read metadata only once
On import of dive media, the timestamp is read from the metadata to check if the image belongs to the selected dives. The pictures are then listed in a dialog. Currently, the metadata is read twice if images are outside of a dive: once in picture_check_valid() and if it turns out that the picture is not valid again in picture_get_time() to display the proper timestamp. Even though metadata-extraction is reasonably fast, this is a bit of an embarrassment. Instead, read the timestamps only once in the constructor of the dialog and from then on only used these timestamps. Keep the timestamps in a QVector. Rename the picture_check_valid() function to picture_check_valid_time() and pass a timestamp instead of a filename. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
92deb7aa70
commit
21b1550739
4 changed files with 16 additions and 12 deletions
|
|
@ -382,7 +382,7 @@ extern void dive_create_picture(struct dive *d, const char *filename, int shift_
|
|||
extern void dive_add_picture(struct dive *d, struct picture *newpic);
|
||||
extern bool dive_remove_picture(struct dive *d, const char *filename);
|
||||
extern unsigned int dive_get_picture_count(struct dive *d);
|
||||
extern bool picture_check_valid(const char *filename, int shift_time);
|
||||
extern bool picture_check_valid_time(timestamp_t timestamp, int shift_time);
|
||||
extern void dive_set_geodata_from_picture(struct dive *d, struct picture *pic);
|
||||
extern void picture_free(struct picture *picture);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue