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>
This commit is contained in:
Miika Turkia 2018-10-23 17:26:02 +03:00 committed by Dirk Hohndel
parent e0e3b63601
commit bb4c2031ef

View file

@ -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();