mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 09:30:13 +03:00
Use the propagator to trigger the e2e info fetch
This is a much better place than the GUI, this way we ensure the propagator is always operating of up to date information. Previously if the propagator kicked in without user interaction from startup (not showing the settings dialog) it would have no E2E information available whatsoever... unsurprisingly it would thus take wrong information at every turn. Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This commit is contained in:
parent
5f611d6e39
commit
b3fb730d5a
3 changed files with 18 additions and 7 deletions
|
@ -581,12 +581,6 @@ void FolderStatusModel::fetchMore(const QModelIndex &parent)
|
||||||
path += info->_path;
|
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);
|
auto *job = new LsColJob(_accountState->account(), path, this);
|
||||||
info->_fetchingJob = job;
|
info->_fetchingJob = job;
|
||||||
job->setProperties(QList<QByteArray>() << "resourcetype"
|
job->setProperties(QList<QByteArray>() << "resourcetype"
|
||||||
|
|
|
@ -510,7 +510,15 @@ void OwncloudPropagator::start(const SyncFileItemVector &items,
|
||||||
|
|
||||||
connect(_rootJob.data(), &PropagatorJob::finished, this, &OwncloudPropagator::emitFinished);
|
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
|
const SyncOptions &OwncloudPropagator::syncOptions() const
|
||||||
|
@ -608,6 +616,13 @@ QString OwncloudPropagator::getFilePath(const QString &tmp_file_name) const
|
||||||
return _localDir + tmp_file_name;
|
return _localDir + tmp_file_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OwncloudPropagator::onFolderEncryptedStatusFetchDone()
|
||||||
|
{
|
||||||
|
disconnect(_account->e2e(), &ClientSideEncryption::folderEncryptedStatusFetchDone,
|
||||||
|
this, &OwncloudPropagator::onFolderEncryptedStatusFetchDone);
|
||||||
|
scheduleNextJob();
|
||||||
|
}
|
||||||
|
|
||||||
void OwncloudPropagator::scheduleNextJob()
|
void OwncloudPropagator::scheduleNextJob()
|
||||||
{
|
{
|
||||||
QTimer::singleShot(0, this, &OwncloudPropagator::scheduleNextJobImpl);
|
QTimer::singleShot(0, this, &OwncloudPropagator::scheduleNextJobImpl);
|
||||||
|
|
|
@ -527,6 +527,8 @@ private slots:
|
||||||
_finishedEmited = true;
|
_finishedEmited = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onFolderEncryptedStatusFetchDone();
|
||||||
|
|
||||||
void scheduleNextJobImpl();
|
void scheduleNextJobImpl();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
Loading…
Reference in a new issue