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,19 +1241,23 @@ void ClientSideEncryption::getPublicKeyFromServer() job->start(); } +void ClientSideEncryption::scheduleFolderEncryptedStatusJob(const QString &path) +{ + auto getEncryptedStatus = new GetFolderEncryptStatusJob(_account, path); + connect(getEncryptedStatus, &GetFolderEncryptStatusJob::encryptStatusReceived, + this, &ClientSideEncryption::folderEncryptedStatusFetched); + connect(getEncryptedStatus, &GetFolderEncryptStatusJob::encryptStatusError, + this, &ClientSideEncryption::folderEncryptedStatusError); + getEncryptedStatus->start(); + + _folderStatusJobs.append(getEncryptedStatus); +} + void ClientSideEncryption::fetchFolderEncryptedStatus() { _refreshingEncryptionStatus = true; _folder2encryptedStatus.clear(); - - auto getEncryptedStatus = new GetFolderEncryptStatusJob(_account, QString()); - connect(getEncryptedStatus, &GetFolderEncryptStatusJob::encryptStatusReceived, - this, &ClientSideEncryption::folderEncryptedStatusFetched); - connect(getEncryptedStatus, &GetFolderEncryptStatusJob::encryptStatusError, - this, &ClientSideEncryption::folderEncryptedStatusError); - getEncryptedStatus->start(); - - _folderStatusJobs.append(getEncryptedStatus); + scheduleFolderEncryptedStatusJob(QString()); } void ClientSideEncryption::folderEncryptedStatusFetched(const QHash& result) 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);