mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Import and merge GPS data from the webservice
Dive locations marked (and named) via the companion app are downloaded from the webservice, parsed and merged with the existing dives. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b1db60ba47
commit
c521aec884
4 changed files with 35 additions and 3 deletions
22
parse-xml.c
22
parse-xml.c
|
@ -909,6 +909,22 @@ static degrees_t parse_degrees(char *buf, char **end)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void gps_lat(char *buffer, void *_dive)
|
||||
{
|
||||
char *end;
|
||||
struct dive *dive = _dive;
|
||||
|
||||
dive->latitude = parse_degrees(buffer, &end);
|
||||
}
|
||||
|
||||
static void gps_long(char *buffer, void *_dive)
|
||||
{
|
||||
char *end;
|
||||
struct dive *dive = _dive;
|
||||
|
||||
dive->longitude = parse_degrees(buffer, &end);
|
||||
}
|
||||
|
||||
static void gps_location(char *buffer, void *_dive)
|
||||
{
|
||||
char *end;
|
||||
|
@ -984,8 +1000,14 @@ static void try_to_fill_dive(struct dive *dive, const char *name, char *buf)
|
|||
return;
|
||||
if (MATCH(".gps", gps_location, dive))
|
||||
return;
|
||||
if (MATCH(".latitude", gps_lat, dive))
|
||||
return;
|
||||
if (MATCH(".longitude", gps_long, dive))
|
||||
return;
|
||||
if (MATCH(".location", utf8_string, &dive->location))
|
||||
return;
|
||||
if (MATCH(".name", utf8_string, &dive->location))
|
||||
return;
|
||||
if (MATCH(".suit", utf8_string, &dive->suit))
|
||||
return;
|
||||
if (MATCH(".divesuit", utf8_string, &dive->suit))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue