mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Properly handle dive sites loaded from XML
We used to always create a new dive site structure when loading dive site data from XML. That is completely bogus, because it can (and does) create duplicate dive sites with the same UUID. Which makes the whole UUID pointless. So instead, look up the existing dive site associated with the UUID loaded from the XML, and try to merge the data properly if we already had dive site information for that UUID. Reported-by: Alessandro Volpi <volpial@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
fc55620d2d
commit
4a550e4d7d
3 changed files with 42 additions and 17 deletions
|
|
@ -64,6 +64,7 @@ uint32_t get_dive_site_uuid_by_gps_and_name(char *name, degrees_t latitude, degr
|
|||
uint32_t get_dive_site_uuid_by_gps_proximity(degrees_t latitude, degrees_t longitude, int distance, struct dive_site **dsp);
|
||||
bool dive_site_is_empty(struct dive_site *ds);
|
||||
void copy_dive_site(struct dive_site *orig, struct dive_site *copy);
|
||||
void merge_dive_site(struct dive_site *a, struct dive_site *b);
|
||||
void clear_dive_site(struct dive_site *ds);
|
||||
unsigned int get_distance(degrees_t lat1, degrees_t lon1, degrees_t lat2, degrees_t lon2);
|
||||
uint32_t find_or_create_dive_site_with_name(const char *name, timestamp_t divetime);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue