diff options
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/command_edit.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/desktop-widgets/command_edit.cpp b/desktop-widgets/command_edit.cpp index 31d34a89b..3419749d7 100644 --- a/desktop-widgets/command_edit.cpp +++ b/desktop-widgets/command_edit.cpp @@ -341,6 +341,14 @@ static struct dive_site *createDiveSite(const QString &name) copy_dive_site(old, ds); free(ds->name); // Free name, as we will overwrite it with our own version } + + // If the current dive has a location, use that as location for the new dive site + if (current_dive) { + location_t loc = dive_get_gps_location(current_dive); + if (has_location(&loc)) + ds->location = loc; + } + ds->name = copy_qstring(name); return ds; } |