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>
This commit is contained in:
Berthold Stoeger 2019-03-03 18:39:12 +01:00 committed by Dirk Hohndel
parent ac1602f512
commit 31291b1c56
16 changed files with 40 additions and 65 deletions

View file

@ -993,7 +993,7 @@ static bool process_raw_buffer(device_data_t *devdata, uint32_t deviceid, char *
} else if (!is_log && dive && !strcmp(tag, "divespot_id")) {
int divespot_id = atoi(val);
if (divespot_id != -1) {
struct dive_site *ds = create_dive_site("from Uemis", dive->when, devdata->sites);
struct dive_site *ds = create_dive_site("from Uemis", devdata->sites);
dive->dive_site = ds;
uemis_mark_divelocation(dive->dc.diveid, divespot_id, ds);
}