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 /desktop-widgets | |
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 'desktop-widgets')
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index 18d424437..c0a4c5018 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -658,17 +658,15 @@ struct dive_site *MainTab::updateDiveSite(struct dive_site *pickedDs, dive *d) if (pickedDs == RECENTLY_ADDED_DIVESITE) { QString name = ui.location->text(); - pickedDs = create_dive_site(qPrintable(name), displayed_dive.when, &dive_site_table); + pickedDs = create_dive_site(qPrintable(name), &dive_site_table); createdNewDive = true; } if (origDs) { if(createdNewDive) { - uint32_t pickedUuid = pickedDs->uuid; copy_dive_site(origDs, pickedDs); free(pickedDs->name); pickedDs->name = copy_qstring(ui.location->text()); - pickedDs->uuid = pickedUuid; qDebug() << "Creating and copying dive site"; } else if (!has_location(&pickedDs->location)) { pickedDs->location = origDs->location; |