diff options
author | Jean Gressmann <jean.gressmann@nokia.com> | 2012-03-16 15:16:04 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-19 11:05:27 +0100 |
commit | 0d9306d72b2d21542d0b128f53095ebf9b6748f4 (patch) | |
tree | f97aab100ee8caf4302a465c3633c96a6c6e36a0 /src/plugins/geoservices/nokia/qgeoroutexmlparser.cpp | |
parent | 44066a6bdee6a6f592ae1a881f813aceb7b52961 (diff) | |
download | qtlocation-0d9306d72b2d21542d0b128f53095ebf9b6748f4.tar.gz |
The Nokia plugin now handles cases where no route can be found.
Change-Id: I5908170d63e9eb63b4dfd72268fa6b82d468bf82
Reviewed-by: Cristian Adam <cristian.adam@nokia.com>
Reviewed-by: Alex <alex.blasche@nokia.com>
Diffstat (limited to 'src/plugins/geoservices/nokia/qgeoroutexmlparser.cpp')
-rw-r--r-- | src/plugins/geoservices/nokia/qgeoroutexmlparser.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/geoservices/nokia/qgeoroutexmlparser.cpp b/src/plugins/geoservices/nokia/qgeoroutexmlparser.cpp index ca5967ff..223fa733 100644 --- a/src/plugins/geoservices/nokia/qgeoroutexmlparser.cpp +++ b/src/plugins/geoservices/nokia/qgeoroutexmlparser.cpp @@ -100,6 +100,13 @@ bool QGeoRouteXmlParser::parseRootElement() return false; } + if (m_reader->name() == QLatin1String("Error")) { + QXmlStreamAttributes attributes = m_reader->attributes(); + if (attributes.value(QLatin1String("type")) == QLatin1String("ApplicationError") + && attributes.value("subtype") == QLatin1String("NoRouteFound")) + return true; + } + bool updateroute = false; if (m_reader->name() != "CalculateRoute" && m_reader->name() != "GetRoute") { m_reader->raiseError(QString("The root element is expected to have the name \"CalculateRoute\" or \"GetRoute\" (root element was named \"%1\").").arg(m_reader->name().toString())); |