mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-25 22:46:04 +03:00
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:
parent
10746d8441
commit
3f20f192e9
1 changed files with 10 additions and 9 deletions
|
@ -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,
|
|
||||||
this, [this](const OCC::SyncResult &result) {
|
|
||||||
Q_UNUSED(result)
|
|
||||||
fileLockSuccess();
|
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()
|
||||||
|
|
Loading…
Reference in a new issue