diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-03-03 18:39:12 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | 31291b1c56bf418732cf6ef52550aada492eff9b (patch) | |
tree | 4ff9e70839ced99fab1d13b7a38d43ece8171f4f /core/parse-xml.c | |
parent | ac1602f5125caae322e3e819a7c622b0be9feca1 (diff) | |
download | subsurface-31291b1c56bf418732cf6ef52550aada492eff9b.tar.gz |
Dive site: set UUID only on save or load
Since the UUID will be overwritten on save and is only used on save
and load, set it only on save or load. For other created dive sites,
leave the UUID field uninitialized.
This means that the UUID will change between saves. Let's see how
the git saver handles that.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/parse-xml.c')
-rw-r--r-- | core/parse-xml.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/parse-xml.c b/core/parse-xml.c index 47b7c2296..fb2982986 100644 --- a/core/parse-xml.c +++ b/core/parse-xml.c @@ -985,7 +985,7 @@ static void divinglog_place(char *place, struct dive_site **ds, struct parser_st state->country ? state->country : ""); *ds = get_dive_site_by_name(buffer, state->sites); if (!*ds) - *ds = create_dive_site(buffer, state->cur_dive->when, state->sites); + *ds = create_dive_site(buffer, state->sites); // TODO: capture the country / city info in the taxonomy instead free(state->city); @@ -1137,7 +1137,7 @@ static void gps_lat(char *buffer, struct dive *dive, struct parser_state *state) location.lat = parse_degrees(buffer, &end); if (!ds) { - dive->dive_site = create_dive_site_with_gps(NULL, &location, dive->when, state->sites); + dive->dive_site = create_dive_site_with_gps(NULL, &location, state->sites); } else { if (ds->location.lat.udeg && ds->location.lat.udeg != location.lat.udeg) fprintf(stderr, "Oops, changing the latitude of existing dive site id %8x name %s; not good\n", ds->uuid, ds->name ?: "(unknown)"); @@ -1153,7 +1153,7 @@ static void gps_long(char *buffer, struct dive *dive, struct parser_state *state location.lon = parse_degrees(buffer, &end); if (!ds) { - dive->dive_site = create_dive_site_with_gps(NULL, &location, dive->when, state->sites); + dive->dive_site = create_dive_site_with_gps(NULL, &location, state->sites); } else { if (ds->location.lon.udeg && ds->location.lon.udeg != location.lon.udeg) fprintf(stderr, "Oops, changing the longitude of existing dive site id %8x name %s; not good\n", ds->uuid, ds->name ?: "(unknown)"); @@ -1191,7 +1191,7 @@ static void gps_in_dive(char *buffer, struct dive *dive, struct parser_state *st state->cur_location = location; dive->dive_site = ds; } else { - dive->dive_site = create_dive_site_with_gps("", &location, dive->when, state->sites); + dive->dive_site = create_dive_site_with_gps("", &location, state->sites); } } else { if (dive_site_has_gps_location(ds) && @@ -2122,7 +2122,7 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size, struct dive_table *tabl /* Measure GPS */ state.cur_location.lat.udeg = (int)((ptr[7] << 24) + (ptr[6] << 16) + (ptr[5] << 8) + (ptr[4] << 0)); state.cur_location.lon.udeg = (int)((ptr[11] << 24) + (ptr[10] << 16) + (ptr[9] << 8) + (ptr[8] << 0)); - state.cur_dive->dive_site = create_dive_site_with_gps("DLF imported", &state.cur_location, state.cur_dive->when, state.sites); + state.cur_dive->dive_site = create_dive_site_with_gps("DLF imported", &state.cur_location, state.sites); break; default: break; |