summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2015-05-22 14:04:55 +0200
committerAlex Blasche <alexander.blasche@theqtcompany.com>2015-05-27 12:14:36 +0000
commitdf1b7cc4c9b423c730354925bd35cc8bca63c6ca (patch)
treee3a989f1f47855eabdaa6ce8caa980742242f447 /src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp
parent445c799514388ae15bc513419a48461a6c7bd573 (diff)
downloadqtlocation-df1b7cc4c9b423c730354925bd35cc8bca63c6ca.tar.gz
Add "here" prefix to all Here geoservices parameters
Task-number: QTBUG-42151 Change-Id: I3d71ee77327478dfdda23af709bee489f83bb9f6 Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp')
-rw-r--r--src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp b/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp
index 0192b6ce..f6d05c36 100644
--- a/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp
+++ b/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp
@@ -75,14 +75,19 @@ namespace
void checkUsageTerms(const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString)
{
- const QString appId = parameters.value(QStringLiteral("app_id")).toString();
- const QString token = parameters.value(QStringLiteral("token")).toString();
+ QString appId, token;
- if (!isValidParameter(appId) || !isValidParameter(token)) {
+ appId = parameters.value(QStringLiteral("here.app_id")).toString();
+ token = parameters.value(QStringLiteral("here.token")).toString();
- *error = QGeoServiceProvider::MissingRequiredParameterError;
- *errorString = QCoreApplication::translate(NOKIA_PLUGIN_CONTEXT_NAME, MISSED_CREDENTIALS);
- }
+ if (isValidParameter(appId) && isValidParameter(token))
+ return;
+
+ if (parameters.contains(QStringLiteral("app_id")) || parameters.contains(QStringLiteral("token")))
+ qWarning() << QStringLiteral("Please prefix 'app_id' and 'token' with prefix 'here' (e.g.: 'here.app_id')");
+
+ *error = QGeoServiceProvider::MissingRequiredParameterError;
+ *errorString = QCoreApplication::translate(NOKIA_PLUGIN_CONTEXT_NAME, MISSED_CREDENTIALS);
}
template<class TInstance>