From b871f6d3557c20fc7d1456e5080c33ea90795c84 Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Sun, 2 Oct 2022 02:45:09 +0200 Subject: Generate QXmppUpload/Download only by FileSharingManager Previously all the providers had to subclass the QXmppUpload/Download. It should be much easier to do additional tasks (e.g. hashing after downloading) now because the manager (and not the provider) decides when to emit the finished signal. Making the encrypted source provider able to handle arbitrary unencrypted sources should be possible too. --- src/client/QXmppHttpFileSharingProvider.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/client/QXmppHttpFileSharingProvider.h') diff --git a/src/client/QXmppHttpFileSharingProvider.h b/src/client/QXmppHttpFileSharingProvider.h index 748c1277..64329659 100644 --- a/src/client/QXmppHttpFileSharingProvider.h +++ b/src/client/QXmppHttpFileSharingProvider.h @@ -29,9 +29,13 @@ public: ~QXmppHttpFileSharingProvider() override; auto downloadFile(const std::any &source, - std::unique_ptr &&target) -> std::shared_ptr override; - auto uploadFile(std::unique_ptr data, - const QXmppFileMetadata &info) -> std::shared_ptr override; + std::unique_ptr target, + std::function reportProgress, + std::function reportFinished) -> std::shared_ptr override; + auto uploadFile(std::unique_ptr source, + const QXmppFileMetadata &info, + std::function reportProgress, + std::function reportFinished) -> std::shared_ptr override; private: std::unique_ptr d; -- cgit v1.2.3