From: Kevin Ottens Date: Tue, 20 Oct 2020 14:48:54 +0000 (+0200) Subject: Factor out the logic to start a new e2ee status job X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~22^2~99^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=399b97442e09119d304d94266eb76d13467ad839;p=nextcloud-desktop.git Factor out the logic to start a new e2ee status job Signed-off-by: Kevin Ottens --- diff --git a/src/libsync/clientsideencryption.cpp b/src/libsync/clientsideencryption.cpp index 13f3b7915..a131206f2 100644 --- a/src/libsync/clientsideencryption.cpp +++ b/src/libsync/clientsideencryption.cpp @@ -1241,21 +1241,25 @@ void ClientSideEncryption::getPublicKeyFromServer() job->start(); } -void ClientSideEncryption::fetchFolderEncryptedStatus() +void ClientSideEncryption::scheduleFolderEncryptedStatusJob(const QString &path) { - _refreshingEncryptionStatus = true; - _folder2encryptedStatus.clear(); - - auto getEncryptedStatus = new GetFolderEncryptStatusJob(_account, QString()); + auto getEncryptedStatus = new GetFolderEncryptStatusJob(_account, path); connect(getEncryptedStatus, &GetFolderEncryptStatusJob::encryptStatusReceived, - this, &ClientSideEncryption::folderEncryptedStatusFetched); + this, &ClientSideEncryption::folderEncryptedStatusFetched); connect(getEncryptedStatus, &GetFolderEncryptStatusJob::encryptStatusError, - this, &ClientSideEncryption::folderEncryptedStatusError); + this, &ClientSideEncryption::folderEncryptedStatusError); getEncryptedStatus->start(); _folderStatusJobs.append(getEncryptedStatus); } +void ClientSideEncryption::fetchFolderEncryptedStatus() +{ + _refreshingEncryptionStatus = true; + _folder2encryptedStatus.clear(); + scheduleFolderEncryptedStatusJob(QString()); +} + void ClientSideEncryption::folderEncryptedStatusFetched(const QHash& result) { auto job = static_cast(sender()); diff --git a/src/libsync/clientsideencryption.h b/src/libsync/clientsideencryption.h index eea0e4a97..355e96535 100644 --- a/src/libsync/clientsideencryption.h +++ b/src/libsync/clientsideencryption.h @@ -111,6 +111,7 @@ signals: void folderEncryptedStatusFetchDone(const QHash &values); private: + void scheduleFolderEncryptedStatusJob(const QString &path); void getPrivateKeyFromServer(); void getPublicKeyFromServer(); void decryptPrivateKey(const QByteArray &key);