summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/maintab.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 8857e3b4f..a70f3901e 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -885,13 +885,17 @@ void MainTab::updateDiveSite(int divenr)
}
newDs = get_dive_site_by_uuid(pickedUuid);
- copy_dive_site(newDs, &displayed_dive_site);
+
+ // Copy everything from the displayed_dive_site, so we have the latitude, longitude, notes, etc.
+ // The user *might* be using wrongly the 'choose dive site' just to edit the name of it, sigh.
+ if(origDs) {
+ copy_dive_site(origDs, newDs);
+ free(newDs->name);
+ newDs->name = copy_string(qPrintable(ui.location->text().constData()));
+ newDs->uuid = pickedUuid;
+ }
if (origDs && pickedUuid != origDs->uuid && same_string(origDs->notes, "SubsurfaceWebservice")) {
- // this is a special case - let's keep the GPS data and
- // remove the original dive site if this was the only user
- newDs->latitude.udeg = origDs->latitude.udeg;
- newDs->longitude.udeg = origDs->longitude.udeg;
if (!is_dive_site_used(origDs->uuid, false)) {
if (verbose)
qDebug() << "delete the autogenerated dive site" << origDs->name;