Lock file when editing locally
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Mon, 28 Nov 2022 17:29:37 +0000 (18:29 +0100)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 7 Dec 2022 11:45:31 +0000 (12:45 +0100)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/editlocallyjob.cpp

index 93ca4762800b8c7c1ab8014f802a35df1cf5814b..67c8cbdc05a7219ea82751ed6f143078ee16eef0 100644 (file)
@@ -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();
     });