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