aboutsummaryrefslogtreecommitdiff
path: root/jobs/downloadfilejob.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-01-12 22:07:33 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-01-14 00:19:00 +0900
commit43710d6a5731778e28d907a3a264bcf74550073e (patch)
tree3f2b82c267cec0dd1b704b40ce3196994d37fb92 /jobs/downloadfilejob.h
parentb3ad6aa8fe62f461c99ae7728482bd9958e38909 (diff)
downloadlibquotient-43710d6a5731778e28d907a3a264bcf74550073e.tar.gz
libquotient-43710d6a5731778e28d907a3a264bcf74550073e.zip
DownloadFileJob
Instead of exposing a QIODevice as GetContentJob does it gets a filename and saves the incoming payload into it.
Diffstat (limited to 'jobs/downloadfilejob.h')
-rw-r--r--jobs/downloadfilejob.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/jobs/downloadfilejob.h b/jobs/downloadfilejob.h
new file mode 100644
index 00000000..d798506c
--- /dev/null
+++ b/jobs/downloadfilejob.h
@@ -0,0 +1,27 @@
+#pragma once
+
+#include "generated/content-repo.h"
+
+namespace QMatrixClient
+{
+ class DownloadFileJob : public GetContentJob
+ {
+ public:
+ enum { FileError = BaseJob::UserDefinedError + 1 };
+
+ DownloadFileJob(const QString& serverName, const QString& mediaId,
+ const QString& localFilename = {});
+
+ QString targetFileName() const;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+
+ void beforeStart(const ConnectionData*) override;
+ void afterStart(const ConnectionData*,
+ QNetworkReply* reply) override;
+ void beforeAbandon(QNetworkReply*) override;
+ Status parseReply(QNetworkReply*) override;
+ };
+}