KWeatherCore
weatherforecastsource.cpp
41 QFile cache(KWeatherCorePrivate::getCacheDirectory(latitude, longitude).path() + QStringLiteral("/cache.json"));
45 auto weatherforecast = WeatherForecast::fromJson(QJsonDocument::fromJson(cache.readAll()).object());
Class represents location query result.
Definition locationqueryresult.h:26
The PendingWeatherForecast class contains the reply to an asynchronous weather forecast request.
Definition pendingweatherforecast.h:26
PendingWeatherForecast * requestData(double latitude, double longitude)
requestData
Definition weatherforecastsource.cpp:39
void setNetworkAccessManager(QNetworkAccessManager *nam)
Set the network access manager to use for network operations.
Definition weatherforecastsource.cpp:73
static WeatherForecast fromJson(const QJsonObject &obj)
construct from json
Definition weatherforecast.cpp:50
KI18NLOCALEDATA_EXPORT const char * fromLocation(float latitude, float longitude)
QDateTime currentDateTime()
bool exists(const QString &fileName)
bool open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags)
QByteArray readAll()
ReadOnly
QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error)
NoLessSafeRedirectPolicy
GenericCacheLocation
QString writableLocation(StandardLocation type)
QString fromUtf8(QByteArrayView str)
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:57:57 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:57:57 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.