aboutsummaryrefslogtreecommitdiffstats
path: root/core/qthelper.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-03-25 09:05:47 +0100
committerGravatar Robert C. Helling <helling@atdotde.de>2019-03-27 13:58:15 +0100
commit40a3e562b01de2827fa6c2c5fd9d46631f91dc36 (patch)
tree194fa05c48b087220cabd206125cc82eaf439d0d /core/qthelper.h
parent04593e8ec4bac2606dec54605c72a6a49cc83f9b (diff)
downloadsubsurface-40a3e562b01de2827fa6c2c5fd9d46631f91dc36.tar.gz
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>
Diffstat (limited to 'core/qthelper.h')
-rw-r--r--core/qthelper.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/qthelper.h b/core/qthelper.h
index ed09d70fb..2cc7dfec4 100644
--- a/core/qthelper.h
+++ b/core/qthelper.h
@@ -82,6 +82,7 @@ QString uiLanguage(QLocale *callerLoc);
QLocale getLocale();
void selectedDivesGasUsed(QVector<QPair<QString, int> > &gasUsed);
QString getUserAgent();
+QString printGPSCoords(const location_t *loc);
#if defined __APPLE__
#define TITLE_OR_TEXT(_t, _m) "", _t + "\n" + _m
@@ -123,7 +124,7 @@ void moveInVector(Vector &v, int rangeBegin, int rangeEnd, int destination)
extern "C" {
#endif
-char *printGPSCoords(const location_t *loc);
+char *printGPSCoordsC(const location_t *loc);
bool in_planner();
bool getProxyString(char **buffer);
bool canReachCloudServer();