mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
ac1602f512
commit
31291b1c56
16 changed files with 40 additions and 65 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue