[CSE] Unlock the folder after a lock

This makes sure the folder will be unlocked for next tests
This commit is contained in:
Tomaz Canabrava 2017-12-12 11:26:54 +01:00
parent 33b1fcfe66
commit e6f835d138
2 changed files with 16 additions and 1 deletions

View file

@ -290,6 +290,20 @@ void PropagateUploadFileCommon::slotFolderLockedSuccessfully(const QByteArray& f
void PropagateUploadFileCommon::slotFolderEncriptedMetadataReceived(const QJsonDocument &json, int statusCode)
{
qDebug() << "Metadata Received" << json.toVariant();
auto *unlockJob = new UnlockEncryptFolderApiJob(propagator()->account(), _folderId, _folderToken, this);
connect(unlockJob, &UnlockEncryptFolderApiJob::success, this, &PropagateUploadFileCommon::slotUnlockEncryptedFolderSuccess);
connect(unlockJob, &UnlockEncryptFolderApiJob::error, this, &PropagateUploadFileCommon::slotUnlockEncryptedFolderError);
unlockJob->start();
}
void PropagateUploadFileCommon::slotUnlockEncryptedFolderSuccess(const QByteArray& fileId)
{
qDebug() << "Unlock Job worked for folder " << fileId;
}
void PropagateUploadFileCommon::slotUnlockEncryptedFolderError(const QByteArray& fileId, int httpStatusCode)
{
qDebug() << "There was an error unlocking " << fileId << httpStatusCode;
}
void PropagateUploadFileCommon::slotFolderLockedError(const QByteArray& fileId, int httpErrorCode)

View file

@ -287,7 +287,8 @@ private slots:
void slotFolderLockedError(const QByteArray& fileId, int httpErrorCode);
void slotTryLock(const QByteArray& fileId);
void slotFolderEncriptedMetadataReceived(const QJsonDocument &json, int statusCode);
void slotUnlockEncryptedFolderSuccess(const QByteArray& fileId);
void slotUnlockEncryptedFolderError(const QByteArray& fileId, int httpReturnCode);
// Private Encryption Stuff
private:
QElapsedTimer _folderLockFirstTry;