aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2018-10-23 17:26:02 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-24 08:04:20 +0100
commitbb4c2031ef662b632eebb41b7173d8fd8324f1c6 (patch)
treecb2a585933fac4eac56df39bbf1da5a12566e290 /desktop-widgets
parente0e3b6360100288907a240888a80ee16fe013f8b (diff)
downloadsubsurface-bb4c2031ef662b632eebb41b7173d8fd8324f1c6.tar.gz
Show coordinates if no tags from reverse geolookup
This will display the dive site coordinates after the Location label if there are no associated tags from reverse geolookup. Thus it'll be clearer for users that we do have GPS location stored for the dive, and might be able to see more easily if the recorded coordinates are correct. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index 3dea277fb..8d5ecdcff 100644
--- a/desktop-widgets/tab-widgets/maintab.cpp
+++ b/desktop-widgets/tab-widgets/maintab.cpp
@@ -419,6 +419,12 @@ void MainTab::updateDiveInfo(bool clear)
if (ds) {
ui.location->setCurrentDiveSiteUuid(ds->uuid);
ui.locationTags->setText(constructLocationTags(&ds->taxonomy, true));
+
+ if (ui.locationTags->text().isEmpty() && has_location(&ds->location)) {
+ const char *coords = printGPSCoords(&ds->location);
+ ui.locationTags->setText(coords);
+ free((void *)coords);
+ }
} else {
ui.location->clear();
ui.locationTags->clear();