diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-12-06 20:37:47 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-06 20:37:47 -0800 |
commit | 4f4b83ccbf85574d4a062dad2e125c764831f0d2 (patch) | |
tree | 5908ab34f155c79aadaa82b6c41894dd5fc83c17 /qthelper.cpp | |
parent | 379fa5f65270da85a4a0816a9fab6589cf70893d (diff) | |
download | subsurface-4f4b83ccbf85574d4a062dad2e125c764831f0d2.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'qthelper.cpp')
-rw-r--r-- | qthelper.cpp | 4 |
1 files 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; |