diff options
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index c74ef527e..884ef547d 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -868,13 +868,19 @@ void MainTab::updateDiveSite(int divenr) uint32_t pickedUuid = ui.location->currDiveSiteUuid(); const uint32_t origUuid = cd->dive_site_uuid; struct dive_site *origDs = get_dive_site_by_uuid(origUuid); + struct dive_site *newDs = NULL; + + if (pickedUuid == origUuid) { + return; + } if (pickedUuid == RECENTLY_ADDED_DIVESITE) { pickedUuid = create_dive_site(ui.location->text().isEmpty() ? qPrintable(tr("New dive site")) : qPrintable(ui.location->text()), displayed_dive.when); - struct dive_site *newDs = get_dive_site_by_uuid(pickedUuid); - copy_dive_site(newDs, &displayed_dive_site); } + newDs = get_dive_site_by_uuid(pickedUuid); + copy_dive_site(newDs, &displayed_dive_site); + if (origDs && pickedUuid != origDs->uuid && same_string(origDs->notes, "SubsurfaceWebservice")) { // this is a special case - let's remove the original dive site if this was the only user if (!is_dive_site_used(origDs->uuid, false)) { |