mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 22:35:27 +00:00
GPS data: create divesite when missing for applied GPS data
Otherwise things will of course crash. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
19e95efd6f
commit
9e85d76766
1 changed files with 4 additions and 0 deletions
|
@ -203,6 +203,10 @@ int GpsLocation::getGpsNum() const
|
|||
static void copy_gps_location(struct gpsTracker &gps, struct dive *d)
|
||||
{
|
||||
struct dive_site *ds = get_dive_site_by_uuid(d->dive_site_uuid);
|
||||
if (!ds) {
|
||||
d->dive_site_uuid = create_dive_site(qPrintable(gps.name), gps.when);
|
||||
ds = get_dive_site_by_uuid(d->dive_site_uuid);
|
||||
}
|
||||
ds->latitude = gps.latitude;
|
||||
ds->longitude = gps.longitude;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue