From d6d3c9a02ffbb739ba197457d465e3e1fddd08d5 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 17 Nov 2020 08:24:07 -0800 Subject: core: fix incorrect QString::asprintf/vasprintf usage These are static functions, they cannot be used as a method on an object to construct that object. commit aa5f2e7c73 ("cleanup: replace deprecated sprintf()/vsprintf() calls") introduced this bug in an ill-advised attempt to deal with a deprecation warning. This caused us to not print GPS coordinates in the UI. Signed-off-by: Dirk Hohndel --- core/qthelper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/qthelper.cpp') diff --git a/core/qthelper.cpp b/core/qthelper.cpp index 5e375997a..fd19e78a3 100644 --- a/core/qthelper.cpp +++ b/core/qthelper.cpp @@ -107,11 +107,11 @@ QString printGPSCoords(const location_t *location) lonmin = (lon % 1000000U) * 60U; latsec = (latmin % 1000000) * 60; lonsec = (lonmin % 1000000) * 60; - result.asprintf("%u°%02d\'%06.3f\"%s %u°%02d\'%06.3f\"%s", + result = QString::asprintf("%u°%02d\'%06.3f\"%s %u°%02d\'%06.3f\"%s", latdeg, latmin / 1000000, latsec / 1000000, qPrintable(lath), londeg, lonmin / 1000000, lonsec / 1000000, qPrintable(lonh)); } else { - result.asprintf("%f %f", (double) lat / 1000000.0, (double) lon / 1000000.0); + result = QString::asprintf("%f %f", (double) lat / 1000000.0, (double) lon / 1000000.0); } return result; } -- cgit v1.2.3-70-g09d2