mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix dive site creation from v2 git storage
Clearly didn't test that part well enough. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a6336d13b3
commit
0ce215e0d9
3 changed files with 30 additions and 8 deletions
23
load-git.c
23
load-git.c
|
@ -23,13 +23,6 @@ struct keyword_action {
|
|||
#define ARRAY_SIZE(array) (sizeof(array)/sizeof(array[0]))
|
||||
|
||||
extern degrees_t parse_degrees(char *buf, char **end);
|
||||
static void parse_dive_gps(char *line, struct membuffer *str, void *_dive)
|
||||
{
|
||||
struct dive *dive = _dive;
|
||||
|
||||
dive->latitude = parse_degrees(line, &line);
|
||||
dive->longitude = parse_degrees(line, &line);
|
||||
}
|
||||
|
||||
static char *get_utf8(struct membuffer *b)
|
||||
{
|
||||
|
@ -145,8 +138,22 @@ static int get_index(const char *line)
|
|||
static int get_hex(const char *line)
|
||||
{ return strtoul(line, NULL, 16); }
|
||||
|
||||
static void parse_dive_gps(char *line, struct membuffer *str, void *_dive)
|
||||
{
|
||||
struct dive *dive = _dive;
|
||||
struct dive_site *ds = get_or_create_dive_site_by_uuid(dive->dive_site_uuid);
|
||||
dive->dive_site_uuid = ds->uuid;
|
||||
ds->latitude = parse_degrees(line, &line);
|
||||
ds->longitude = parse_degrees(line, &line);
|
||||
}
|
||||
|
||||
static void parse_dive_location(char *line, struct membuffer *str, void *_dive)
|
||||
{ struct dive *dive = _dive; dive->location = get_utf8(str); }
|
||||
{
|
||||
struct dive *dive = _dive;
|
||||
struct dive_site *ds = get_or_create_dive_site_by_uuid(dive->dive_site_uuid);
|
||||
dive->dive_site_uuid = ds->uuid;
|
||||
ds->name = get_utf8(str);
|
||||
}
|
||||
|
||||
static void parse_dive_divemaster(char *line, struct membuffer *str, void *_dive)
|
||||
{ struct dive *dive = _dive; dive->divemaster = get_utf8(str); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue