From ff6ab388267c275a6b21a174d61fc37e7175d3d5 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Mon, 28 Nov 2022 18:29:37 +0100 Subject: [PATCH] Lock file when editing locally Signed-off-by: Claudio Cambra --- src/gui/editlocallyjob.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/editlocallyjob.cpp b/src/gui/editlocallyjob.cpp index 93ca47628..67c8cbdc0 100644 --- a/src/gui/editlocallyjob.cpp +++ b/src/gui/editlocallyjob.cpp @@ -546,7 +546,8 @@ void EditLocallyJob::openFile() // In case the VFS mode is enabled and a file is not yet hydrated, we must call QDesktopServices::openUrl // from a separate thread, or, there will be a freeze. To avoid searching for a specific folder and checking // if the VFS is enabled - we just always call it from a separate thread. - QtConcurrent::run([localFilePath]() { + QtConcurrent::run([localFilePath, this]() { + _accountState->account()->setLockFileState(_relPath, _folderForFile->journalDb(), SyncFileItem::LockStatus::LockedItem); QDesktopServices::openUrl(QUrl::fromLocalFile(localFilePath)); Systray::instance()->destroyEditFileLocallyLoadingDialog(); }); -- 2.30.2