From 5619874cadc3c0f7524883d11da3ed0de17b28fb Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 17 Mar 2014 15:48:52 +0100 Subject: Nokia plugin: Move message about malformed reply to common messages. Change-Id: Ic5611c5d8bc7ac697bed5ddb9294f6ed306ab2b7 Reviewed-by: Christian Stenger --- src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp | 4 +++- src/plugins/geoservices/nokia/qgeoerror_messages.cpp | 1 + src/plugins/geoservices/nokia/qgeoerror_messages.h | 1 + src/plugins/geoservices/nokia/qgeoroutereply_nokia.cpp | 5 ++++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp b/src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp index 8690eb65..f1d0f4d4 100644 --- a/src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp +++ b/src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp @@ -48,8 +48,10 @@ #include "qgeocodereply_nokia.h" #include "qgeocodexmlparser.h" +#include "qgeoerror_messages.h" #include +#include Q_DECLARE_METATYPE(QList) @@ -136,7 +138,7 @@ void QGeoCodeReplyNokia::parseError(const QString &errorString) Q_UNUSED(errorString) setError(QGeoCodeReply::ParseError, - tr("The response from the service was not in a recognisable format.")); + QCoreApplication::translate(NOKIA_PLUGIN_CONTEXT_NAME, RESPONSE_NOT_RECOGNIZABLE)); abort(); } diff --git a/src/plugins/geoservices/nokia/qgeoerror_messages.cpp b/src/plugins/geoservices/nokia/qgeoerror_messages.cpp index 05cb93fa..5995876b 100644 --- a/src/plugins/geoservices/nokia/qgeoerror_messages.cpp +++ b/src/plugins/geoservices/nokia/qgeoerror_messages.cpp @@ -59,5 +59,6 @@ const char REMOVING_CATEGORY_NOT_SUPPORTED[] = QT_TRANSLATE_NOOP("QtLocationQML" const char PARSE_ERROR[] = QT_TRANSLATE_NOOP("QtLocationQML", "Error parsing response."); const char NETWORK_ERROR[] = QT_TRANSLATE_NOOP("QtLocationQML", "Network error."); const char CANCEL_ERROR[] = QT_TRANSLATE_NOOP("QtLocationQML", "Request was canceled."); +const char RESPONSE_NOT_RECOGNIZABLE[] = QT_TRANSLATE_NOOP("QtLocationQML", "The response from the service was not in a recognizable format."); QT_END_NAMESPACE diff --git a/src/plugins/geoservices/nokia/qgeoerror_messages.h b/src/plugins/geoservices/nokia/qgeoerror_messages.h index 03a85dc0..b1227629 100644 --- a/src/plugins/geoservices/nokia/qgeoerror_messages.h +++ b/src/plugins/geoservices/nokia/qgeoerror_messages.h @@ -63,6 +63,7 @@ extern const char REMOVING_CATEGORY_NOT_SUPPORTED[]; extern const char PARSE_ERROR[]; extern const char NETWORK_ERROR[]; extern const char CANCEL_ERROR[]; +extern const char RESPONSE_NOT_RECOGNIZABLE[]; QT_END_NAMESPACE diff --git a/src/plugins/geoservices/nokia/qgeoroutereply_nokia.cpp b/src/plugins/geoservices/nokia/qgeoroutereply_nokia.cpp index 72f2c60d..861436c5 100644 --- a/src/plugins/geoservices/nokia/qgeoroutereply_nokia.cpp +++ b/src/plugins/geoservices/nokia/qgeoroutereply_nokia.cpp @@ -48,9 +48,12 @@ #include "qgeoroutereply_nokia.h" #include "qgeoroutexmlparser.h" +#include "qgeoerror_messages.h" #include +#include + Q_DECLARE_METATYPE(QList) QT_BEGIN_NAMESPACE @@ -150,7 +153,7 @@ void QGeoRouteReplyNokia::parserError(const QString &errorString) --m_parsers; setError(QGeoRouteReply::ParseError, - tr("The response from the service was not in a recognisable format.")); + QCoreApplication::translate(NOKIA_PLUGIN_CONTEXT_NAME, RESPONSE_NOT_RECOGNIZABLE)); abort(); } -- cgit v1.2.1