KWeatherCore
weatherforecastsource.cpp
40 QFile cache(KWeatherCorePrivate::getCacheDirectory(latitude, longitude).path() + QStringLiteral("/cache.json"));
44 auto weatherforecast = WeatherForecast::fromJson(QJsonDocument::fromJson(cache.readAll()).object());
static WeatherForecast fromJson(const QJsonObject &obj)
construct from json
Definition: weatherforecast.cpp:58
QJsonObject object() const const
QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error)
ReadOnly
QString fromUtf8(const char *str, int size)
virtual bool open(QIODevice::OpenMode mode) override
QDateTime currentDateTime()
QString writableLocation(QStandardPaths::StandardLocation type)
bool exists() const const
PendingWeatherForecast * requestData(double latitude, double longitude)
requestData
Definition: weatherforecastsource.cpp:38
bool isEmpty() const const
void setNetworkAccessManager(QNetworkAccessManager *nam)
Set the network access manager to use for network operations.
Definition: weatherforecastsource.cpp:72
GenericCacheLocation
Class represents location query result.
Definition: locationqueryresult.h:25
NoLessSafeRedirectPolicy
QByteArray readAll()
The PendingWeatherForecast class contains the reply to an asynchronous weather forecast request.
Definition: pendingweatherforecast.h:25
const KI18NLOCALEDATA_EXPORT char * fromLocation(float latitude, float longitude)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Sep 22 2023 03:55:38 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Sep 22 2023 03:55:38 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.