mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 13:35:58 +03:00
Factor out the logic to start a new e2ee status job
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This commit is contained in:
parent
cbc40b5a15
commit
399b97442e
2 changed files with 14 additions and 9 deletions
|
@ -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<QString, bool>& result)
|
||||
|
|
|
@ -111,6 +111,7 @@ signals:
|
|||
void folderEncryptedStatusFetchDone(const QHash<QString, bool> &values);
|
||||
|
||||
private:
|
||||
void scheduleFolderEncryptedStatusJob(const QString &path);
|
||||
void getPrivateKeyFromServer();
|
||||
void getPublicKeyFromServer();
|
||||
void decryptPrivateKey(const QByteArray &key);
|
||||
|
|
Loading…
Reference in a new issue