mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Cleanup: make dive_set_geodata_from_picture() local to dive.c
The function dive_set_geodata_from_picture() is only used in dive.c. Make it local to that translation unit. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
0893f87beb
commit
9c87c0dafd
2 changed files with 13 additions and 14 deletions
26
core/dive.c
26
core/dive.c
|
@ -3958,6 +3958,19 @@ bool picture_check_valid_time(timestamp_t timestamp, int shift_time)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void dive_set_geodata_from_picture(struct dive *dive, struct picture *picture)
|
||||||
|
{
|
||||||
|
struct dive_site *ds = dive->dive_site;
|
||||||
|
if (!dive_site_has_gps_location(ds) && has_location(&picture->location)) {
|
||||||
|
if (ds) {
|
||||||
|
ds->location = picture->location;
|
||||||
|
} else {
|
||||||
|
dive->dive_site = create_dive_site_with_gps("", &picture->location, dive->when);
|
||||||
|
invalidate_dive_cache(dive);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void create_picture(const char *filename, int shift_time, bool match_all)
|
void create_picture(const char *filename, int shift_time, bool match_all)
|
||||||
{
|
{
|
||||||
struct metadata metadata;
|
struct metadata metadata;
|
||||||
|
@ -4004,19 +4017,6 @@ unsigned int dive_get_picture_count(struct dive *dive)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dive_set_geodata_from_picture(struct dive *dive, struct picture *picture)
|
|
||||||
{
|
|
||||||
struct dive_site *ds = dive->dive_site;
|
|
||||||
if (!dive_site_has_gps_location(ds) && has_location(&picture->location)) {
|
|
||||||
if (ds) {
|
|
||||||
ds->location = picture->location;
|
|
||||||
} else {
|
|
||||||
dive->dive_site = create_dive_site_with_gps("", &picture->location, dive->when);
|
|
||||||
invalidate_dive_cache(dive);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void picture_free(struct picture *picture)
|
void picture_free(struct picture *picture)
|
||||||
{
|
{
|
||||||
if (!picture)
|
if (!picture)
|
||||||
|
|
|
@ -378,7 +378,6 @@ extern void dive_add_picture(struct dive *d, struct picture *newpic);
|
||||||
extern bool dive_remove_picture(struct dive *d, const char *filename);
|
extern bool dive_remove_picture(struct dive *d, const char *filename);
|
||||||
extern unsigned int dive_get_picture_count(struct dive *d);
|
extern unsigned int dive_get_picture_count(struct dive *d);
|
||||||
extern bool picture_check_valid_time(timestamp_t timestamp, 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);
|
extern void picture_free(struct picture *picture);
|
||||||
|
|
||||||
extern bool has_gaschange_event(const struct dive *dive, const struct divecomputer *dc, int idx);
|
extern bool has_gaschange_event(const struct dive *dive, const struct divecomputer *dc, int idx);
|
||||||
|
|
Loading…
Add table
Reference in a new issue