diff options
-rw-r--r-- | examples/positioning/weatherinfo/appmodel.cpp | 5 | ||||
-rw-r--r-- | src/positioning/doc/src/examples/weatherinfo.qdoc | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/examples/positioning/weatherinfo/appmodel.cpp b/examples/positioning/weatherinfo/appmodel.cpp index a773cfca..4d8806b8 100644 --- a/examples/positioning/weatherinfo/appmodel.cpp +++ b/examples/positioning/weatherinfo/appmodel.cpp @@ -154,6 +154,7 @@ public: int minMsBeforeNewRequest; QTimer delayedCityRequestTimer; QTimer requestNewWeatherTimer; + QString app_ident; AppModelPrivate() : src(NULL), @@ -170,6 +171,7 @@ public: requestNewWeatherTimer.setSingleShot(false); requestNewWeatherTimer.setInterval(20*60*1000); // 20 min throttle.invalidate(); + app_ident = QStringLiteral("36496bad1955bf3365448965a42b9eac"); } }; @@ -304,6 +306,7 @@ void AppModel::queryCity() query.addQueryItem("lat", latitude); query.addQueryItem("lon", longitude); query.addQueryItem("mode", "json"); + query.addQueryItem("APPID", d->app_ident); url.setQuery(query); qCDebug(requestsLog) << "submitting request"; @@ -385,6 +388,7 @@ void AppModel::refreshWeather() query.addQueryItem("q", d->city); query.addQueryItem("mode", "json"); + query.addQueryItem("APPID", d->app_ident); url.setQuery(query); QNetworkReply *rep = d->nam->get(QNetworkRequest(url)); @@ -443,6 +447,7 @@ void AppModel::handleWeatherNetworkData(QObject *replyObj) query.addQueryItem("q", d->city); query.addQueryItem("mode", "json"); query.addQueryItem("cnt", "5"); + query.addQueryItem("APPID", d->app_ident); url.setQuery(query); QNetworkReply *rep = d->nam->get(QNetworkRequest(url)); diff --git a/src/positioning/doc/src/examples/weatherinfo.qdoc b/src/positioning/doc/src/examples/weatherinfo.qdoc index e32127d4..3db6fcbf 100644 --- a/src/positioning/doc/src/examples/weatherinfo.qdoc +++ b/src/positioning/doc/src/examples/weatherinfo.qdoc @@ -45,6 +45,8 @@ \include examples-run.qdocinc + The example uses weather data provided by \l http://www.openweathermap.org. + The key part of this example is the application's data model, contained in the WeatherData and AppModel classes. WeatherData represents the weather information taken from the HTTP service. It is a simple data class, but we |