summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/locationinformation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/locationinformation.cpp')
-rw-r--r--desktop-widgets/locationinformation.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/desktop-widgets/locationinformation.cpp b/desktop-widgets/locationinformation.cpp
index f4da411af..af3fa513f 100644
--- a/desktop-widgets/locationinformation.cpp
+++ b/desktop-widgets/locationinformation.cpp
@@ -113,13 +113,10 @@ void LocationInformationWidget::updateLabels()
ui.diveSiteNotes->setPlainText(diveSite->notes);
else
ui.diveSiteNotes->clear();
- if (has_location(&diveSite->location)) {
- char *coords = printGPSCoords(&diveSite->location);
- ui.diveSiteCoordinates->setText(coords);
- free(coords);
- } else {
+ if (has_location(&diveSite->location))
+ ui.diveSiteCoordinates->setText(printGPSCoords(&diveSite->location));
+ else
ui.diveSiteCoordinates->clear();
- }
ui.locationTags->setText(constructLocationTags(&taxonomy, false));
}
@@ -138,10 +135,8 @@ void LocationInformationWidget::updateGpsCoordinates(const location_t &location)
{
QString oldText = ui.diveSiteCoordinates->text();
- char *coords = printGPSCoords(&location);
- ui.diveSiteCoordinates->setText(coords);
+ ui.diveSiteCoordinates->setText(printGPSCoords(&location));
enableLocationButtons(has_location(&location));
- free(coords);
if (oldText != ui.diveSiteCoordinates->text())
markChangedWidget(ui.diveSiteCoordinates);
}