diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-01-12 22:01:26 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-01-12 23:15:01 +0900 |
commit | 0199c963de5a46a6526389829e210f5c68226911 (patch) | |
tree | 3c8f7dfc57bbaa96fd794eb3f59d2af03af44813 /jobs/generated | |
parent | 93cb0e5897cc94d8cc691bbe62f5b0093dd0a00f (diff) | |
download | libquotient-0199c963de5a46a6526389829e210f5c68226911.tar.gz libquotient-0199c963de5a46a6526389829e210f5c68226911.zip |
BaseJob::Data -> RequestData; support QIODevice* input/output
Diffstat (limited to 'jobs/generated')
-rw-r--r-- | jobs/generated/content-repo.cpp | 20 | ||||
-rw-r--r-- | jobs/generated/content-repo.h | 11 |
2 files changed, 15 insertions, 16 deletions
diff --git a/jobs/generated/content-repo.cpp b/jobs/generated/content-repo.cpp index ec6683bb..93aa838c 100644 --- a/jobs/generated/content-repo.cpp +++ b/jobs/generated/content-repo.cpp @@ -19,7 +19,7 @@ class UploadContentJob::Private QString contentUri; }; -UploadContentJob::UploadContentJob(QByteArray content, const QString& filename, const QString& contentType) +UploadContentJob::UploadContentJob(QIODevice* content, const QString& filename, const QString& contentType) : BaseJob(HttpVerb::Post, "UploadContentJob", basePath % "/upload") , d(new Private) @@ -55,7 +55,7 @@ class GetContentJob::Private public: QString contentType; QString contentDisposition; - QByteArray content; + QIODevice* content; }; GetContentJob::GetContentJob(const QString& serverName, const QString& mediaId) @@ -78,7 +78,7 @@ const QString& GetContentJob::contentDisposition() const return d->contentDisposition; } -QByteArray GetContentJob::content() const +QIODevice* GetContentJob::content() const { return d->content; } @@ -87,7 +87,7 @@ BaseJob::Status GetContentJob::parseReply(QNetworkReply* reply) { d->contentType = reply->rawHeader("Content-Type"); d->contentDisposition = reply->rawHeader("Content-Disposition"); - d->content = reply->readAll(); + d->content = reply; return Success; } @@ -96,7 +96,7 @@ class GetContentOverrideNameJob::Private public: QString contentType; QString contentDisposition; - QByteArray content; + QIODevice* content; }; GetContentOverrideNameJob::GetContentOverrideNameJob(const QString& serverName, const QString& mediaId, const QString& fileName) @@ -119,7 +119,7 @@ const QString& GetContentOverrideNameJob::contentDisposition() const return d->contentDisposition; } -QByteArray GetContentOverrideNameJob::content() const +QIODevice* GetContentOverrideNameJob::content() const { return d->content; } @@ -128,7 +128,7 @@ BaseJob::Status GetContentOverrideNameJob::parseReply(QNetworkReply* reply) { d->contentType = reply->rawHeader("Content-Type"); d->contentDisposition = reply->rawHeader("Content-Disposition"); - d->content = reply->readAll(); + d->content = reply; return Success; } @@ -136,7 +136,7 @@ class GetContentThumbnailJob::Private { public: QString contentType; - QByteArray content; + QIODevice* content; }; GetContentThumbnailJob::GetContentThumbnailJob(const QString& serverName, const QString& mediaId, int width, int height, const QString& method) @@ -160,7 +160,7 @@ const QString& GetContentThumbnailJob::contentType() const return d->contentType; } -QByteArray GetContentThumbnailJob::content() const +QIODevice* GetContentThumbnailJob::content() const { return d->content; } @@ -168,7 +168,7 @@ QByteArray GetContentThumbnailJob::content() const BaseJob::Status GetContentThumbnailJob::parseReply(QNetworkReply* reply) { d->contentType = reply->rawHeader("Content-Type"); - d->content = reply->readAll(); + d->content = reply; return Success; } diff --git a/jobs/generated/content-repo.h b/jobs/generated/content-repo.h index 1d844651..0796322b 100644 --- a/jobs/generated/content-repo.h +++ b/jobs/generated/content-repo.h @@ -6,8 +6,7 @@ #include "../basejob.h" -#include <QtCore/QByteArray> -#include <QtCore/QString> +#include <QtCore/QIODevice> namespace QMatrixClient @@ -17,7 +16,7 @@ namespace QMatrixClient class UploadContentJob : public BaseJob { public: - explicit UploadContentJob(QByteArray content, const QString& filename = {}, const QString& contentType = {}); + explicit UploadContentJob(QIODevice* content, const QString& filename = {}, const QString& contentType = {}); ~UploadContentJob() override; const QString& contentUri() const; @@ -38,7 +37,7 @@ namespace QMatrixClient const QString& contentType() const; const QString& contentDisposition() const; - QByteArray content() const; + QIODevice* content() const; protected: Status parseReply(QNetworkReply* reply) override; @@ -56,7 +55,7 @@ namespace QMatrixClient const QString& contentType() const; const QString& contentDisposition() const; - QByteArray content() const; + QIODevice* content() const; protected: Status parseReply(QNetworkReply* reply) override; @@ -73,7 +72,7 @@ namespace QMatrixClient ~GetContentThumbnailJob() override; const QString& contentType() const; - QByteArray content() const; + QIODevice* content() const; protected: Status parseReply(QNetworkReply* reply) override; |