From 1b8ac21f6be42d777f38d1cf921bcadcb11f82f8 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 29 Sep 2015 20:10:29 -0400 Subject: Correctly handle updating the name of dive sites from GPS If the user downloaded the GPS data from the Subsurface webservice before naming a dive site, we run into a special case where entering a new name for a dive location should just update the name of the automatically named site which already has the correct GPS information. Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'qt-ui/maintab.cpp') diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index d52966924..ffa5d82d6 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -892,9 +892,13 @@ void MainTab::updateDiveSite(int divenr) 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 + // 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)) { - qDebug() << "delete the autogenerated dive site" << origDs->name; + if (verbose) + qDebug() << "delete the autogenerated dive site" << origDs->name; delete_dive_site(origDs->uuid); } } -- cgit v1.2.3-70-g09d2