mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Cleanup: provide printGPSCoords in C and C++ versions
printGPSCoords() returned a newly allocated C-style string. Most callers simply made a QString out of it and freed the C-style string. This is paradoxical, as printGPSCoords internally works with QStrings and converts them to C-style on return. Therefore, let printGPSCoords() return a QString and create a printGPSCoordsC() wrapper for the two C-callers. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
04593e8ec4
commit
40a3e562b0
11 changed files with 24 additions and 39 deletions
|
@ -410,11 +410,8 @@ void MainTab::updateDiveInfo(bool clear)
|
|||
ui.location->setCurrentDiveSite(ds);
|
||||
ui.locationTags->setText(constructLocationTags(&ds->taxonomy, true));
|
||||
|
||||
if (ui.locationTags->text().isEmpty() && has_location(&ds->location)) {
|
||||
char *coords = printGPSCoords(&ds->location);
|
||||
ui.locationTags->setText(coords);
|
||||
free(coords);
|
||||
}
|
||||
if (ui.locationTags->text().isEmpty() && has_location(&ds->location))
|
||||
ui.locationTags->setText(printGPSCoords(&ds->location));
|
||||
} else {
|
||||
ui.location->clear();
|
||||
ui.locationTags->clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue