path += info->_path;
}
- //TODO: This is the correct place, but this doesn't seems to be the right
- // Way to call fetchFolderEncryptedStatus.
- if (_accountState->account()->capabilities().clientSideEncryptionAvailable()) {
- _accountState->account()->e2e()->fetchFolderEncryptedStatus();
- }
-
auto *job = new LsColJob(_accountState->account(), path, this);
info->_fetchingJob = job;
job->setProperties(QList<QByteArray>() << "resourcetype"
connect(_rootJob.data(), &PropagatorJob::finished, this, &OwncloudPropagator::emitFinished);
- scheduleNextJob();
+ // If needed, make sure we have up to date E2E information before scheduling the first job
+ // otherwise we start right away
+ if (_account->capabilities().clientSideEncryptionAvailable()) {
+ connect(_account->e2e(), &ClientSideEncryption::folderEncryptedStatusFetchDone,
+ this, &OwncloudPropagator::onFolderEncryptedStatusFetchDone);
+ _account->e2e()->fetchFolderEncryptedStatus();
+ } else {
+ scheduleNextJob();
+ }
}
const SyncOptions &OwncloudPropagator::syncOptions() const
return _localDir + tmp_file_name;
}
+void OwncloudPropagator::onFolderEncryptedStatusFetchDone()
+{
+ disconnect(_account->e2e(), &ClientSideEncryption::folderEncryptedStatusFetchDone,
+ this, &OwncloudPropagator::onFolderEncryptedStatusFetchDone);
+ scheduleNextJob();
+}
+
void OwncloudPropagator::scheduleNextJob()
{
QTimer::singleShot(0, this, &OwncloudPropagator::scheduleNextJobImpl);