🔒 Repository is read-only – file editing is disabled.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
diff -Naur a/src/location/configure.json b/qtlocation/src/location/configure.json
--- a/src/location/configure.json 2023-10-11 15:01:35.000000000 +0200
+++ b/src/location/configure.json 2024-05-08 13:23:51.501947834 +0200
@@ -9,7 +9,7 @@
"label": "Qt.labs.location experimental QML plugin",
"purpose": "Provides experimental QtLocation QML types",
"section": "Location",
- "condition": "config.opengl",
+ "condition": "features.opengl",
"output": [ "privateFeature" ]
},
"geoservices_osm": {
diff -Naur a/src/location/labs/qsg/qgeomapobjectqsgsupport.cpp b/qtlocation/src/location/labs/qsg/qgeomapobjectqsgsupport.cpp
--- a/src/location/labs/qsg/qgeomapobjectqsgsupport.cpp 2023-10-11 15:01:35.000000000 +0200
+++ b/src/location/labs/qsg/qgeomapobjectqsgsupport.cpp 2024-05-08 13:23:51.501947834 +0200
@@ -158,7 +158,7 @@
if (!root)
return;
- if (m_mapObjectsRootNode && m_mapObjectsRootNode->parent())
+ if (m_mapObjectsRootNode && !m_mapObjectsRootNode->parent())
root->appendChildNode(m_mapObjectsRootNode.get());
if (!m_mapObjectsRootNode) {
diff -Naur a/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.cpp b/qtlocation/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.cpp
--- a/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.cpp 2023-10-11 15:01:35.000000000 +0200
+++ b/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.cpp 2024-05-08 13:23:51.501947834 +0200
@@ -66,11 +66,8 @@
Q_ASSERT(networkManager);
m_networkManager->setParent(this);
- if (parameters.contains(QStringLiteral("here.token")))
- m_token = parameters.value(QStringLiteral("here.token")).toString();
-
- if (parameters.contains(QStringLiteral("here.app_id")))
- m_applicationId = parameters.value(QStringLiteral("here.app_id")).toString();
+ if (parameters.contains(QStringLiteral("here.apiKey")))
+ m_apiKey = parameters.value(QStringLiteral("here.apiKey")).toString();
if (error)
*error = QGeoServiceProvider::NoError;
@@ -85,12 +82,9 @@
{
QString authenticationString;
- if (!m_token.isEmpty() && !m_applicationId.isEmpty()) {
- authenticationString += "?app_code=";
- authenticationString += m_token;
-
- authenticationString += "&app_id=";
- authenticationString += m_applicationId;
+ if (!m_apiKey.isEmpty()) {
+ authenticationString += "?apiKey=";
+ authenticationString += m_apiKey;
}
return authenticationString;
diff -Naur a/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.h b/qtlocation/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.h
--- a/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.h 2023-10-11 15:01:35.000000000 +0200
+++ b/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.h 2024-05-08 13:23:51.501947834 +0200
@@ -82,8 +82,7 @@
QGeoNetworkAccessManager *m_networkManager;
QGeoUriProvider *m_uriProvider;
QGeoUriProvider *m_reverseGeocodingUriProvider;
- QString m_token;
- QString m_applicationId;
+ QString m_apiKey;
};
QT_END_NAMESPACE
diff -Naur a/src/plugins/geoservices/nokia/qgeoerror_messages.cpp b/qtlocation/src/plugins/geoservices/nokia/qgeoerror_messages.cpp
--- a/src/plugins/geoservices/nokia/qgeoerror_messages.cpp 2023-10-11 15:01:35.000000000 +0200
+++ b/src/plugins/geoservices/nokia/qgeoerror_messages.cpp 2024-05-08 13:23:51.501947834 +0200
@@ -39,7 +39,7 @@
QT_BEGIN_NAMESPACE
const char NOKIA_PLUGIN_CONTEXT_NAME[] = "QtLocationQML";
-const char MISSED_CREDENTIALS[] = QT_TRANSLATE_NOOP("QtLocationQML", "Qt Location requires app_id and token parameters.\nPlease register at https://developer.here.com/ to get your personal application credentials.");
+const char MISSED_CREDENTIALS[] = QT_TRANSLATE_NOOP("QtLocationQML", "Qt Location requires apiKey parameter.\nPlease register at https://developer.here.com/ to get your personal application credentials.");
const char SAVING_PLACE_NOT_SUPPORTED[] = QT_TRANSLATE_NOOP("QtLocationQML", "Saving places is not supported.");
const char REMOVING_PLACE_NOT_SUPPORTED[] = QT_TRANSLATE_NOOP("QtLocationQML", "Removing places is not supported.");
const char SAVING_CATEGORY_NOT_SUPPORTED[] = QT_TRANSLATE_NOOP("QtLocationQML", "Saving categories is not supported.");
diff -Naur a/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp b/qtlocation/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp
--- a/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp 2023-10-11 15:01:35.000000000 +0200
+++ b/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp 2024-05-08 13:23:51.501947834 +0200
@@ -60,8 +60,7 @@
Q_ASSERT(networkManager);
m_networkManager->setParent(this);
- m_appId = parameters.value(QStringLiteral("here.app_id")).toString();
- m_token = parameters.value(QStringLiteral("here.token")).toString();
+ m_apiKey = parameters.value(QStringLiteral("here.apiKey")).toString();
QGeoRouteRequest::FeatureTypes featureTypes;
featureTypes |= QGeoRouteRequest::TollFeature;
@@ -219,18 +218,16 @@
return QStringList();
QStringList requests;
- QString baseRequest = QStringLiteral("http://");
+ QString baseRequest = QStringLiteral("https://");
baseRequest += m_uriProvider->getCurrentHost();
baseRequest += QStringLiteral("/routing/7.2/calculateroute.xml");
baseRequest += QStringLiteral("?alternatives=");
baseRequest += QString::number(request.numberAlternativeRoutes());
- if (!m_appId.isEmpty() && !m_token.isEmpty()) {
- baseRequest += QStringLiteral("&app_id=");
- baseRequest += m_appId;
- baseRequest += QStringLiteral("&token=");
- baseRequest += m_token;
+ if (!m_apiKey.isEmpty()) {
+ baseRequest += QStringLiteral("&apiKey=");
+ baseRequest += m_apiKey;
}
const QList<QVariantMap> metadata = request.waypointsMetadata();
@@ -281,7 +278,7 @@
return QStringList();
QStringList requests;
- QString baseRequest = "http://";
+ QString baseRequest = "https://";
baseRequest += m_uriProvider->getCurrentHost();
baseRequest += "/routing/7.2/getroute.xml";
diff -Naur a/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.h b/qtlocation/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.h
--- a/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.h 2023-10-11 15:01:35.000000000 +0200
+++ b/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.h 2024-05-08 13:23:51.501947834 +0200
@@ -77,8 +77,7 @@
QGeoNetworkAccessManager *m_networkManager;
QGeoUriProvider *m_uriProvider;
- QString m_appId;
- QString m_token;
+ QString m_apiKey;
};
QT_END_NAMESPACE
diff -Naur a/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp b/qtlocation/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp
--- a/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp 2023-10-11 15:01:35.000000000 +0200
+++ b/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp 2024-05-08 13:23:51.501947834 +0200
@@ -75,20 +75,15 @@
void checkUsageTerms(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString)
{
- QString appId, token;
+ const QString apiKey = parameters.value(QStringLiteral("here.apiKey")).toString();
- appId = parameters.value(QStringLiteral("here.app_id")).toString();
- token = parameters.value(QStringLiteral("here.token")).toString();
-
- if (isValidParameter(appId) && isValidParameter(token))
+ if (isValidParameter(apiKey))
return;
- else if (!isValidParameter(appId))
- qWarning() << "Invalid here.app_id";
else
- qWarning() << "Invalid here.token";
+ qWarning() << "Invalid here.apiKey";
- 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')");
+ if (parameters.contains(QStringLiteral("apiKey")))
+ qWarning() << QStringLiteral("Please prefix 'apiKey' with prefix 'here' (e.g.: 'here.apiKey')");
*error = QGeoServiceProvider::MissingRequiredParameterError;
*errorString = QCoreApplication::translate(NOKIA_PLUGIN_CONTEXT_NAME, MISSED_CREDENTIALS);
diff -Naur a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp b/qtlocation/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp
--- a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp 2023-10-11 15:01:35.000000000 +0200
+++ b/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp 2024-05-08 13:23:51.501947834 +0200
@@ -84,8 +84,7 @@
m_tileSize = qMax(tileSize.width(), tileSize.height());
m_networkManager->setParent(this);
- m_applicationId = parameters.value(QStringLiteral("here.app_id")).toString();
- m_token = parameters.value(QStringLiteral("here.token")).toString();
+ m_apiKey = parameters.value(QStringLiteral("here.apiKey")).toString();
}
QGeoTileFetcherNokia::~QGeoTileFetcherNokia()
@@ -127,7 +126,7 @@
if (!m_engineNokia)
return QString();
- static const QString http("http://");
+ static const QString http("https://");
static const QString path("/maptile/2.1/maptile/newest/");
static const QChar slash('/');
@@ -152,12 +151,9 @@
static const QString slashpng("/png8");
requestString += slashpng;
- if (!m_token.isEmpty() && !m_applicationId.isEmpty()) { // TODO: remove the if
- requestString += "?token=";
- requestString += m_token;
-
- requestString += "&app_id=";
- requestString += m_applicationId;
+ if (!m_apiKey.isEmpty()) { // TODO: remove the if
+ requestString += "?apiKey=";
+ requestString += m_apiKey;
}
requestString += "&ppi=" + QString::number(ppi);
@@ -235,14 +231,9 @@
// No "lg" param means that we want English.
}
-QString QGeoTileFetcherNokia::token() const
-{
- return m_token;
-}
-
-QString QGeoTileFetcherNokia::applicationId() const
+QString QGeoTileFetcherNokia::apiKey() const
{
- return m_applicationId;
+ return m_apiKey;
}
void QGeoTileFetcherNokia::copyrightsFetched()
@@ -271,19 +262,14 @@
void QGeoTileFetcherNokia::fetchCopyrightsData()
{
- QString copyrightUrl = QStringLiteral("http://");
+ QString copyrightUrl = QStringLiteral("https://");
copyrightUrl += m_baseUriProvider->getCurrentHost();
copyrightUrl += QStringLiteral("/maptile/2.1/copyright/newest?output=json");
- if (!token().isEmpty()) {
- copyrightUrl += QStringLiteral("&token=");
- copyrightUrl += token();
- }
-
- if (!applicationId().isEmpty()) {
- copyrightUrl += QStringLiteral("&app_id=");
- copyrightUrl += applicationId();
+ if (!apiKey().isEmpty()) {
+ copyrightUrl += QStringLiteral("&apiKey=");
+ copyrightUrl += apiKey();
}
QNetworkRequest netRequest((QUrl(copyrightUrl)));
@@ -303,19 +289,14 @@
void QGeoTileFetcherNokia::fetchVersionData()
{
- QString versionUrl = QStringLiteral("http://");
+ QString versionUrl = QStringLiteral("https://");
versionUrl += m_baseUriProvider->getCurrentHost();
versionUrl += QStringLiteral("/maptile/2.1/version");
- if (!token().isEmpty()) {
- versionUrl += QStringLiteral("?token=");
- versionUrl += token();
- }
-
- if (!applicationId().isEmpty()) {
- versionUrl += QStringLiteral("&app_id=");
- versionUrl += applicationId();
+ if (!apiKey().isEmpty()) {
+ versionUrl += QStringLiteral("?apiKey=");
+ versionUrl += apiKey();
}
QNetworkRequest netRequest((QUrl(versionUrl)));
diff -Naur a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.h b/qtlocation/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.h
--- a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.h 2023-10-11 15:01:35.000000000 +0200
+++ b/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.h 2024-05-08 13:23:51.501947834 +0200
@@ -62,8 +62,7 @@
QGeoTiledMapReply *getTileImage(const QGeoTileSpec &spec);
- QString token() const;
- QString applicationId() const;
+ QString apiKey() const;
public Q_SLOTS:
void copyrightsFetched();
@@ -82,11 +81,10 @@
QGeoNetworkAccessManager *m_networkManager;
int m_tileSize;
int m_ppi;
- QString m_token;
QNetworkReply *m_copyrightsReply;
QNetworkReply *m_versionReply;
- QString m_applicationId;
+ QString m_apiKey;
QGeoUriProvider *m_baseUriProvider;
QGeoUriProvider *m_aerialUriProvider;
};
diff -Naur a/src/plugins/geoservices/nokia/qgeouriprovider.cpp b/qtlocation/src/plugins/geoservices/nokia/qgeouriprovider.cpp
--- a/src/plugins/geoservices/nokia/qgeouriprovider.cpp 2023-10-11 15:01:35.000000000 +0200
+++ b/src/plugins/geoservices/nokia/qgeouriprovider.cpp 2024-05-08 13:23:51.501947834 +0200
@@ -61,7 +61,7 @@
QString QGeoUriProvider::getCurrentHost() const
{
if (m_maxSubdomains) {
- QString result(m_firstSubdomain.toLatin1() + QRandomGenerator::global()->bounded(m_maxSubdomains));
+ QString result(static_cast<char>(m_firstSubdomain.toLatin1() + QRandomGenerator::global()->bounded(m_maxSubdomains)));
result += '.' + m_currentHost;
return result;
}
diff -Naur a/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp b/qtlocation/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp
--- a/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp 2023-10-11 15:01:35.000000000 +0200
+++ b/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp 2024-05-08 13:23:51.505281187 +0200
@@ -208,8 +208,7 @@
m_locales.append(QLocale());
- m_appId = parameters.value(QStringLiteral("here.app_id")).toString();
- m_appCode = parameters.value(QStringLiteral("here.token")).toString();
+ m_apiKey = parameters.value(QStringLiteral("here.apiKey")).toString();
m_theme = parameters.value(IconThemeKey, QString()).toString();
@@ -237,7 +236,7 @@
QPlaceDetailsReply *QPlaceManagerEngineNokiaV2::getPlaceDetails(const QString &placeId)
{
- QUrl requestUrl(QString::fromLatin1("http://") + m_uriProvider->getCurrentHost() +
+ QUrl requestUrl(QString::fromLatin1("https://") + m_uriProvider->getCurrentHost() +
QStringLiteral("/places/v1/places/") + placeId);
QUrlQuery queryItems;
@@ -268,7 +267,7 @@
networkReply = sendRequest(u);
} else {
- QUrl requestUrl(QString::fromLatin1("http://") + m_uriProvider->getCurrentHost() +
+ QUrl requestUrl(QString::fromLatin1("https://") + m_uriProvider->getCurrentHost() +
QStringLiteral("/places/v1/places/") + request.placeId() +
QStringLiteral("/media/"));
@@ -410,7 +409,7 @@
networkReply = sendRequest(u);
} else if (!query.searchTerm().isEmpty()) {
// search term query
- QUrl requestUrl(QString::fromLatin1("http://") + m_uriProvider->getCurrentHost() +
+ QUrl requestUrl(QString::fromLatin1("https://") + m_uriProvider->getCurrentHost() +
QStringLiteral("/places/v1/discover/search"));
queryItems.addQueryItem(QStringLiteral("q"), query.searchTerm());
@@ -432,7 +431,7 @@
return reply;
} else if (!query.recommendationId().isEmpty()) {
- QUrl requestUrl(QString::fromLatin1("http://") + m_uriProvider->getCurrentHost() +
+ QUrl requestUrl(QString::fromLatin1("https://") + m_uriProvider->getCurrentHost() +
QStringLiteral("/places/v1/places/") + query.recommendationId() +
QStringLiteral("/related/recommended"));
@@ -443,7 +442,7 @@
networkReply = sendRequest(requestUrl);
} else {
// category search
- QUrl requestUrl(QStringLiteral("http://") + m_uriProvider->getCurrentHost() +
+ QUrl requestUrl(QStringLiteral("https://") + m_uriProvider->getCurrentHost() +
QStringLiteral("/places/v1/discover/explore"));
QStringList ids;
@@ -498,7 +497,7 @@
return reply;
}
- QUrl requestUrl(QString::fromLatin1("http://") + m_uriProvider->getCurrentHost() +
+ QUrl requestUrl(QString::fromLatin1("https://") + m_uriProvider->getCurrentHost() +
QStringLiteral("/places/v1/suggest"));
QUrlQuery queryItems;
@@ -633,7 +632,7 @@
for (auto it = m_tempTree.keyBegin(), end = m_tempTree.keyEnd(); it != end; ++it) {
if (*it == QString())
continue;
- QUrl requestUrl(QString::fromLatin1("http://") + m_uriProvider->getCurrentHost() +
+ QUrl requestUrl(QString::fromLatin1("https://") + m_uriProvider->getCurrentHost() +
QStringLiteral("/places/v1/categories/places/") + *it);
QNetworkReply *networkReply = sendRequest(requestUrl);
connect(networkReply, SIGNAL(finished()), this, SLOT(categoryReplyFinished()));
@@ -831,8 +830,7 @@
QNetworkReply *QPlaceManagerEngineNokiaV2::sendRequest(const QUrl &url)
{
QUrlQuery queryItems(url);
- queryItems.addQueryItem(QStringLiteral("app_id"), m_appId);
- queryItems.addQueryItem(QStringLiteral("app_code"), m_appCode);
+ queryItems.addQueryItem(QStringLiteral("apiKey"), m_apiKey);
QUrl requestUrl = url;
requestUrl.setQuery(queryItems);
diff -Naur a/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.h b/qtlocation/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.h
--- a/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.h 2023-10-11 15:01:35.000000000 +0200
+++ b/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.h 2024-05-08 13:23:51.505281187 +0200
@@ -122,8 +122,7 @@
QPointer<QPlaceCategoriesReplyHere> m_categoryReply;
QHash<QString, QNetworkReply *> m_categoryRequests;
- QString m_appId;
- QString m_appCode;
+ QString m_apiKey;
QString m_localDataPath;
QString m_theme;
diff -Naur a/src/plugins/geoservices/nokia/uri_constants.cpp b/qtlocation/src/plugins/geoservices/nokia/uri_constants.cpp
--- a/src/plugins/geoservices/nokia/uri_constants.cpp 2023-10-11 15:01:35.000000000 +0200
+++ b/src/plugins/geoservices/nokia/uri_constants.cpp 2024-05-08 13:23:51.505281187 +0200
@@ -37,11 +37,11 @@
QT_BEGIN_NAMESPACE
-const QString ROUTING_HOST = QLatin1String("route.api.here.com");
-const QString GEOCODING_HOST = QLatin1String("geocoder.api.here.com");
-const QString REVERSE_GEOCODING_HOST = QLatin1String("reverse.geocoder.api.here.com");
-const QString PLACES_HOST = QLatin1String("places.api.here.com");
-const QString MAP_TILES_HOST = QLatin1String("1-4.base.maps.api.here.com");
-const QString MAP_TILES_HOST_AERIAL = QLatin1String("1-4.aerial.maps.api.here.com");
+const QString ROUTING_HOST = QLatin1String("route.ls.hereapi.com");
+const QString GEOCODING_HOST = QLatin1String("geocoder.ls.hereapi.com");
+const QString REVERSE_GEOCODING_HOST = QLatin1String("reverse.geocoder.ls.hereapi.com");
+const QString PLACES_HOST = QLatin1String("places.ls.hereapi.com");
+const QString MAP_TILES_HOST = QLatin1String("1-4.base.maps.ls.hereapi.com");
+const QString MAP_TILES_HOST_AERIAL = QLatin1String("1-4.aerial.maps.ls.hereapi.com");
QT_END_NAMESPACE