Skip to content

Commit

Permalink
Ensure we are checking lock state once file has been synced after set…
Browse files Browse the repository at this point in the history
…ting lock

Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Dec 6, 2022
1 parent fc03fbd commit 5ef63db
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/gui/editlocallyjob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 5ef63db

Please sign in to comment.