mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 13:35:58 +03:00
Change EncryptFolderJob path convention
It had a different path convention than all the other jobs, most likely for legacy reasons because of the tight coupling it had to the settings dialog. Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This commit is contained in:
parent
ee8e0fa332
commit
b667bdda14
3 changed files with 8 additions and 4 deletions
|
@ -302,7 +302,12 @@ void AccountSettings::slotMarkSubfolderEncrypted(const FolderStatusModel::SubFol
|
|||
return;
|
||||
}
|
||||
|
||||
auto job = new OCC::EncryptFolderJob(accountsState()->account(), folderInfo->_path, folderInfo->_fileId, this);
|
||||
// Folder info have directory paths in Foo/Bar/ convention...
|
||||
Q_ASSERT(!folderInfo->_path.startsWith('/') && folderInfo->_path.endsWith('/'));
|
||||
// But EncryptFolderJob expects directory path Foo/Bar convention
|
||||
const auto path = folderInfo->_path.chopped(1);
|
||||
|
||||
auto job = new OCC::EncryptFolderJob(accountsState()->account(), path, folderInfo->_fileId, this);
|
||||
connect(job, &OCC::EncryptFolderJob::finished, this, &AccountSettings::slotEncryptFolderFinished);
|
||||
job->start();
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ QString EncryptFolderJob::errorString() const
|
|||
|
||||
void EncryptFolderJob::slotEncryptionFlagSuccess(const QByteArray &fileId)
|
||||
{
|
||||
_account->e2e()->setFolderEncryptedStatus(_path, true);
|
||||
_account->e2e()->setFolderEncryptedStatus(_path + '/', true);
|
||||
|
||||
auto lockJob = new LockEncryptFolderApiJob(_account, fileId, this);
|
||||
connect(lockJob, &LockEncryptFolderApiJob::success,
|
||||
|
|
|
@ -240,8 +240,7 @@ void PropagateRemoteMkdir::slotMkcolJobFinished()
|
|||
// We're expecting directory path in /Foo/Bar convention...
|
||||
Q_ASSERT(_job->path().startsWith('/') && !_job->path().endsWith('/'));
|
||||
// But encryption job expect it in Foo/Bar/ convention
|
||||
// (otherwise we won't store the right string in the e2e object)
|
||||
const auto path = QString(_job->path().mid(1) + '/');
|
||||
const auto path = _job->path().mid(1);
|
||||
|
||||
auto job = new OCC::EncryptFolderJob(propagator()->account(), path, _item->_fileId, this);
|
||||
connect(job, &OCC::EncryptFolderJob::finished, this, &PropagateRemoteMkdir::slotEncryptFolderFinished);
|
||||
|
|
Loading…
Reference in a new issue