From 31291b1c56bf418732cf6ef52550aada492eff9b Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 3 Mar 2019 18:39:12 +0100 Subject: 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 --- desktop-widgets/tab-widgets/maintab.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'desktop-widgets') 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; -- cgit v1.2.3-70-g09d2