summaryrefslogtreecommitdiffstats
path: root/qthelper.cpp
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2014-01-12 07:37:12 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-12 21:06:12 +0700
commite4f2c86c8259f9cba3c3b7f32a6262a51cb03b91 (patch)
tree5512dc6a6a41f334b59e172ac83be503fba1d682 /qthelper.cpp
parent23973e8abdfb1354de9920cc1c5896a4fc84d25b (diff)
downloadsubsurface-e4f2c86c8259f9cba3c3b7f32a6262a51cb03b91.tar.gz
Improving matching of ISO 6709 GPS format
ISO 6709 format dictates that the format includes characters ° (degree), ' and ". If we only test for the coordinates starting with decimal, we match also the decimal notation on this test. Thus adding test for the degree sign not to match input as ISO 6709 when coordinates are given in decimal notation. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qthelper.cpp')
-rw-r--r--qthelper.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qthelper.cpp b/qthelper.cpp
index 9d503cb6a..cd4720908 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -119,7 +119,7 @@ bool parseGpsText(const QString& gps_text, double *latitude, double *longitude)
// ISO 6709 Annex D representation
// http://en.wikipedia.org/wiki/ISO_6709#Representation_at_the_human_interface_.28Annex_D.29
- if (gps_text.at(0).isDigit()) {
+ if (gps_text.at(0).isDigit() && gps_text.count(UTF8_DEGREE) > 0) {
gpsStyle = ISO6709D;
regExp = QString("(\\d+)[" UTF8_DEGREE "\\s](\\d+)[\'\\s](\\d+)([,\\.](\\d+))?[\"\\s]([NS%1%2])"
"\\s*(\\d+)[" UTF8_DEGREE "\\s](\\d+)[\'\\s](\\d+)([,\\.](\\d+))?[\"\\s]([EW%3%4])")