job->start();
}
-void ClientSideEncryption::fetchFolderEncryptedStatus() {
+void ClientSideEncryption::fetchFolderEncryptedStatus()
+{
_refreshingEncryptionStatus = true;
auto getEncryptedStatus = new GetFolderEncryptStatusJob(_account, QString());
connect(getEncryptedStatus, &GetFolderEncryptStatusJob::encryptStatusReceived,
connect(getEncryptedStatus, &GetFolderEncryptStatusJob::encryptStatusError,
this, &ClientSideEncryption::folderEncryptedStatusError);
getEncryptedStatus->start();
+
+ _folderStatusJobs.append(getEncryptedStatus);
}
void ClientSideEncryption::folderEncryptedStatusFetched(const QHash<QString, bool>& result)
{
+ auto job = static_cast<GetFolderEncryptStatusJob *>(sender());
+ Q_ASSERT(job);
+
+ _folderStatusJobs.removeAll(job);
+
_refreshingEncryptionStatus = false;
_folder2encryptedStatus = result;
qCDebug(lcCse) << "Retrieved correctly the encrypted status of the folders." << result;
void ClientSideEncryption::folderEncryptedStatusError(int error)
{
+ auto job = static_cast<GetFolderEncryptStatusJob *>(sender());
+ Q_ASSERT(job);
+
+ _folderStatusJobs.removeAll(job);
+
_refreshingEncryptionStatus = false;
qCDebug(lcCse) << "Failed to retrieve the status of the folders." << error;
emit folderEncryptedStatusFetchDone({});
namespace OCC {
+class GetFolderEncryptStatusJob;
+
QString baseUrl();
namespace EncryptionHelper {
//TODO: Save this on disk.
QHash<QByteArray, QByteArray> _folder2token;
QHash<QString, bool> _folder2encryptedStatus;
+ QVector<GetFolderEncryptStatusJob*> _folderStatusJobs;
public:
//QSslKey _privateKey;