mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Copy coordinates when renaming site
Let's not discard our GPS location when editing site name on mobile. Fixes #1051 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
67742856b2
commit
9e787a2476
1 changed files with 14 additions and 2 deletions
|
@ -575,10 +575,22 @@ parsed:
|
|||
if (ds)
|
||||
locationtext = ds->name;
|
||||
if (!same_string(locationtext, qPrintable(location))) {
|
||||
double lat = 0, lon = 0;
|
||||
diveChanged = true;
|
||||
// this is not ideal - and it's missing the gps information
|
||||
// but for now let's just create a new dive site
|
||||
|
||||
// As we create a new dive site, we need to grab the
|
||||
// coordinates if we have them
|
||||
|
||||
if (ds && ds->latitude.udeg && ds->longitude.udeg) {
|
||||
lat = ds->latitude.udeg;
|
||||
lon = ds->longitude.udeg;
|
||||
}
|
||||
ds = get_dive_site_by_uuid(create_dive_site(qPrintable(location), d->when));
|
||||
|
||||
if (lat && lon) {
|
||||
ds->latitude.udeg = lat;
|
||||
ds->longitude.udeg = lon;
|
||||
}
|
||||
d->dive_site_uuid = ds->uuid;
|
||||
}
|
||||
if (!gps.isEmpty()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue