mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Allow a comma in decimal GPS coordinates
this is the format used by Google maps and thus this... Fixes #875 Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ffa6a23590
commit
44f5a72822
1 changed files with 1 additions and 1 deletions
|
@ -190,7 +190,7 @@ static bool parseCoord(const QString& txt, int& pos, const QString& positives,
|
||||||
* Parse special coordinate formats that cannot be handled by parseCoord.
|
* Parse special coordinate formats that cannot be handled by parseCoord.
|
||||||
*/
|
*/
|
||||||
static bool parseSpecialCoords(const QString& txt, double& latitude, double& longitude) {
|
static bool parseSpecialCoords(const QString& txt, double& latitude, double& longitude) {
|
||||||
QRegExp xmlFormat("(-?\\d+(?:\\.\\d+)?)\\s+(-?\\d+(?:\\.\\d+)?)");
|
QRegExp xmlFormat("(-?\\d+(?:\\.\\d+)?),?\\s+(-?\\d+(?:\\.\\d+)?)");
|
||||||
if (xmlFormat.exactMatch(txt)) {
|
if (xmlFormat.exactMatch(txt)) {
|
||||||
latitude = xmlFormat.cap(1).toDouble();
|
latitude = xmlFormat.cap(1).toDouble();
|
||||||
longitude = xmlFormat.cap(2).toDouble();
|
longitude = xmlFormat.cap(2).toDouble();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue