Kgapi
job.cpp
33 QString filename = QString::fromLocal8Bit(qgetenv("KGAPI_SESSION_LOGFILE")) + QLatin1Char('.') + QString::number(QCoreApplication::applicationPid());
36 qCWarning(KGAPIDebug) << "Failed to open logging file" << filename << ":" << mFile->errorString();
173 case KGAPI2::ResumeIncomplete: /** << OK status (partially uploaded a file via resumable upload) */
177 case KGAPI2::TemporarilyMovedUseSameMethod: /** << Temporarily moved - Google provides a new URL where to send the request which must use the original
179 case KGAPI2::TemporarilyMoved: { /** << Temporarily moved - Google provides a new URL where to send the request */
180 qCDebug(KGAPIDebug) << "Google says: Temporarily moved to " << reply->header(QNetworkRequest::LocationHeader).toUrl();
187 case KGAPI2::BadRequest: /** << Bad request - malformed data, API changed, something went wrong... */
189 qCWarning(KGAPIDebug) << "Bad request" << reply->url() << ", Google replied '" << rawData << "'";
197 case KGAPI2::Unauthorized: /** << Unauthorized - Access token has expired, request a new token */
234 q->setErrorString(tr("Conflict. Remote resource is newer than local.\n\nGoogle replied '%1'").arg(msg));
245 q->setErrorString(tr("Requested resource does not exist anymore.\n\nGoogle replied '%1'").arg(msg));
256 q->setErrorString(tr("Internal server error. Try again later.\n\nGoogle replied '%1'").arg(msg));
275 q->setErrorString(tr("Maximum quota exceeded. Try again later.\n\nGoogle replied '%1'").arg(msg));
296 qCWarning(KGAPIDebug) << "Unknown error" << reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
344 standardParamQuery.addQueryItem(Job::StandardParams::PrettyPrint, Utils::bool2Str(prettyPrint));
513void Job::enqueueRequest(const QNetworkRequest &request, const QByteArray &data, const QString &contentType)
void progress(KGAPI2::Job *job, int processed, int total)
Emitted when a job progress changes.
Job(QObject *parent=nullptr)
Constructor for jobs that don't require authentication.
Definition job.cpp:365
virtual void aboutToFinish()
This method is invoked right before finished() is emitted.
Definition job.cpp:535
virtual bool handleError(int statusCode, const QByteArray &rawData)
Called when an error occurs.
Definition job.cpp:549
void setErrorString(const QString &errorString)
Set job error description to errorString.
Definition job.cpp:401
void setAccount(const AccountPtr &account)
Set account to be used to authenticate requests.
Definition job.cpp:441
void setFields(const QStringList &fields)
Set subset of fields to include in the response.
Definition job.cpp:471
virtual void aboutToStart()
This method is invoked right before Job::start() is called.
Definition job.cpp:539
void setPrettyPrint(bool prettyPrint)
Sets whether response will have indentations and line breaks.
Definition job.cpp:456
virtual void enqueueRequest(const QNetworkRequest &request, const QByteArray &data=QByteArray(), const QString &contentType=QString())
Enqueues request in dispatcher queue.
Definition job.cpp:513
Q_SCRIPTABLE CaptureState status()
char * toString(const EngineQuery &query)
@ QuotaExceeded
User quota has been exceeded, the request should be sent again later.
Definition types.h:204
@ TemporarilyMovedUseSameMethod
The object is located at a different URL provided in the reply. The same request method must be used.
Definition types.h:196
void error(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonOk, Options options=Notify)
qint64 applicationPid()
QByteArray readAll()
WriteOnly
QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error)
bool isNull() const const
QVariant toVariant() const const
T & first()
bool isEmpty() const const
void finished(QNetworkReply *reply)
QVariant attribute(QNetworkRequest::Attribute code) const const
QVariant header(QNetworkRequest::KnownHeaders header) const const
QByteArray rawHeader(const QByteArray &headerName) const const
QList< QByteArray > rawHeaderList() const const
QNetworkRequest request() const const
QUrl url() const const
HttpStatusCodeAttribute
LocationHeader
QByteArray rawHeader(const QByteArray &headerName) const const
QList< QByteArray > rawHeaderList() const const
void setRawHeader(const QByteArray &headerName, const QByteArray &headerValue)
void setUrl(const QUrl &url)
QUrl url() const const
Q_EMITQ_EMIT
QString & append(QChar ch)
QString arg(Args &&... args) const const
QString fromLocal8Bit(QByteArrayView str)
QString number(double n, char format, int precision)
QString join(QChar separator) const const
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
singleShot
void timeout()
void setQuery(const QString &query, ParsingMode mode)
QString toDisplayString(FormattingOptions options) const const
int toInt(bool *ok) const const
QMap< QString, QVariant > toMap() const const
QUrl toUrl() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:11 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:11 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.