From 4f4b83ccbf85574d4a062dad2e125c764831f0d2 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 6 Dec 2013 20:37:47 -0800 Subject: Correctly parse translated GPS coordinates Minor oversight in commit 917b47b79cb8 ("Parse localized GPS string") - we accepted the translated hemisphere indicators in the regular expression, but then didn't use them later when comparing with the result of applying the regular expression. Fixes #331 Signed-off-by: Dirk Hohndel --- qthelper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qthelper.cpp b/qthelper.cpp index 273bfd4b4..ff9bf9492 100644 --- a/qthelper.cpp +++ b/qthelper.cpp @@ -115,9 +115,9 @@ bool parseGpsText(const QString& gps_text, double *latitude, double *longitude) // qDebug() << "Hemisphere" << r.cap(5) << "deg" << r.cap(6) << "min" << r.cap(7) << "decimal" << r.cap(8); *latitude = r.cap(2).toInt() + (r.cap(3) + QString(".") + r.cap(4)).toDouble() / 60.0; *longitude = r.cap(6).toInt() + (r.cap(7) + QString(".") + r.cap(8)).toDouble() / 60.0; - if (r.cap(1) == "S") + if (r.cap(1) == "S" || r.cap(1) == tr("S")) *latitude *= -1.0; - if (r.cap(5) == "W") + if (r.cap(5) == "W" || r.cap(5) == tr("W")) *longitude *= -1.0; // qDebug("%s -> %8.5f / %8.5f", gps_text.toLocal8Bit().data(), *latitude, *longitude); return true; -- cgit v1.2.3-70-g09d2