Ensure we are checking lock state once file has been synced after setting lock

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2022-12-05 21:22:08 +01:00
parent 10746d8441
commit 3f20f192e9
No known key found for this signature in database
GPG key ID: C839200C384636B0

View file

@ -566,22 +566,23 @@ void EditLocallyJob::lockFile()
return;
}
_folderConnections.append(connect(_accountState->account().data(), &Account::lockFileSuccess,
this, [this] {
_folderForFile->journalDb()->schedulePathForRemoteDiscovery(_relPath);
_folderForFile->scheduleThisFolderSoon();
}));
_folderConnections.append(connect(_folderForFile, &Folder::syncFinished,
this, [this](const OCC::SyncResult &result) {
Q_UNUSED(result)
fileLockSuccess();
_folderForFile->setSyncPaused(true);
_folderConnections.append(connect(&_folderForFile->syncEngine(), &SyncEngine::itemCompleted,
this, [this](const SyncFileItemPtr &item) {
if (item->_file == _relPath && item->_locked == SyncFileItem::LockStatus::LockedItem) {
fileLockSuccess();
}
}));
_folderConnections.append(connect(_accountState->account().data(), &Account::lockFileError,
this, &EditLocallyJob::fileLockError));
_folderForFile->accountState()->account()->setLockFileState(_relPath,
_folderForFile->journalDb(),
SyncFileItem::LockStatus::LockedItem);
_folderForFile->journalDb()->schedulePathForRemoteDiscovery(_relPath);
FolderMan::instance()->forceSyncForFolder(_folderForFile);
}
void EditLocallyJob::disconnectFolderSignals()