mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-27 20:58:47 +00:00
mobile: correctly store manually entered GPS
If there was no pre-existing dive site for a dive, manually entered GPS information didn't get saved. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
07745893e5
commit
1e527fb9f0
1 changed files with 5 additions and 1 deletions
|
@ -850,6 +850,7 @@ static void setupDivesite(DiveSiteChange &res, struct dive *d, struct dive_site
|
|||
res.location = location;
|
||||
} else {
|
||||
res.createdDs.reset(alloc_dive_site_with_name(locationtext));
|
||||
res.createdDs->location = location;
|
||||
d->dive_site = res.createdDs.get();
|
||||
}
|
||||
res.changed = true;
|
||||
|
@ -981,7 +982,10 @@ bool QMLManager::checkLocation(DiveSiteChange &res, struct dive *d, QString loca
|
|||
if (formatDiveGPS(d) != gps) {
|
||||
double lat, lon;
|
||||
if (parseGpsText(gps, &lat, &lon)) {
|
||||
qDebug() << "parsed GPS, using it";
|
||||
if (location.isEmpty())
|
||||
location = gps;
|
||||
if (verbose)
|
||||
qDebug() << "parsed GPS" << gps << ", using it for dive site" << location;
|
||||
// there are valid GPS coordinates - just use them
|
||||
setupDivesite(res, d, ds, lat, lon, qPrintable(location));
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue