Kgapi
fileabstractresumablejob.cpp
107 QString tempRangeHeader = QStringLiteral("bytes %1-%2/%3").arg(uploadedSize).arg(uploadedSize + partData.size() - 1);
113 QString totalSymbol = isTotalSizeKnown() ? QString::number(totalUploadSize) : QStringLiteral("*");
119 qCDebug(KGAPIDebug) << "Sending chunk of" << partData.size() << "bytes with Content-Range header" << rangeHeader;
196FileAbstractResumableJob::FileAbstractResumableJob(const FilePtr &metadata, const AccountPtr &account, QObject *parent)
203FileAbstractResumableJob::FileAbstractResumableJob(QIODevice *device, const AccountPtr &account, QObject *parent)
210FileAbstractResumableJob::FileAbstractResumableJob(QIODevice *device, const FilePtr &metadata, const AccountPtr &account, QObject *parent)
250 qCDebug(KGAPIDebug) << "Previous last chunk was" << lastChunk.size() << "bytes and could use" << missing << "bytes more, adding to it";
296 connect(reply, &QNetworkReply::uploadProgress, this, [this](qint64 bytesSent, qint64 totalBytes) {
302void FileAbstractResumableJob::handleReply(const QNetworkReply *reply, const QByteArray &rawData)
354 const QString readRange = QString::fromUtf8(reply->rawHeader(QStringLiteral("Range").toUtf8()));
Abstract superclass for KGAPI2::Drive::File create or modify jobs that use chunked uploading of the f...
Definition fileabstractresumablejob.h:42
void write(const QByteArray &data)
This function writes all the bytes in data to the upload session.
Definition fileabstractresumablejob.cpp:235
void readyWrite(KGAPI2::Drive::FileAbstractResumableJob *job)
Emitted when job requires more data to proceed.
void handleReply(const QNetworkReply *reply, const QByteArray &rawData) override
KGAPI2::Job::handleReply implementation.
Definition fileabstractresumablejob.cpp:302
~FileAbstractResumableJob() override
Destructor.
FilePtr metadata() const
Returns metadata supplied at Job creation or retrieved on Job completion.
Definition fileabstractresumablejob.cpp:220
virtual QUrl createUrl()=0
Generates url that will be used during upload session start.
FileAbstractResumableJob(const AccountPtr &account, QObject *parent=nullptr)
Constructs a job that will upload an Untitled file in the users root folder.
Definition fileabstractresumablejob.cpp:190
void dispatchRequest(QNetworkAccessManager *accessManager, const QNetworkRequest &request, const QByteArray &data, const QString &contentType) override
KGAPI2::Job::dispatchRequest implementation.
Definition fileabstractresumablejob.cpp:281
void setUploadSize(int size)
Sets the total upload size and is required for progress reporting via the Job::progress() signal.
Definition fileabstractresumablejob.cpp:225
void setErrorString(const QString &errorString)
Set job error description to errorString.
Definition job.cpp:401
virtual void enqueueRequest(const QNetworkRequest &request, const QByteArray &data=QByteArray(), const QString &contentType=QString())
Enqueues request in dispatcher queue.
Definition job.cpp:513
KSERVICE_EXPORT KService::List query(FilterFunc filterFunc)
QVariant read(const QByteArray &data, int versionOverride=0)
QByteArray & append(QByteArrayView data)
bool isEmpty() const const
qsizetype length() const const
QByteArray mid(qsizetype pos, qsizetype len) const const
qsizetype size() const const
T & first()
bool isEmpty() const const
qsizetype size() const const
QMimeType mimeTypeForFileNameAndData(const QString &fileName, QIODevice *device) const const
name
QNetworkReply * post(const QNetworkRequest &request, QHttpMultiPart *multiPart)
QNetworkReply * put(const QNetworkRequest &request, QHttpMultiPart *multiPart)
QVariant attribute(QNetworkRequest::Attribute code) const const
QVariant header(QNetworkRequest::KnownHeaders header) const const
QByteArray rawHeader(const QByteArray &headerName) const const
void uploadProgress(qint64 bytesSent, qint64 bytesTotal)
HttpStatusCodeAttribute
ContentLengthHeader
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const
QString tr(const char *sourceText, const char *disambiguation, int n)
QString arg(Args &&... args) const const
QString fromUtf8(QByteArrayView str)
bool isEmpty() const const
QString number(double n, char format, int precision)
QByteArray toUtf8() const const
void setQuery(const QString &query, ParsingMode mode)
int toInt(bool *ok) const const
QString toString() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.