Edit locally. Do not lock if locking is disabled on the server.
authoralex-z <blackslayer4@gmail.com>
Thu, 26 Jan 2023 16:00:14 +0000 (17:00 +0100)
committeralex-z <blackslayer4@gmail.com>
Thu, 26 Jan 2023 16:00:14 +0000 (17:00 +0100)
Signed-off-by: alex-z <blackslayer4@gmail.com>
src/gui/editlocallyjob.cpp

index 7764e0b053f3596a7325a4340a37b2b6d36b70d1..a95ad1375dca539edc615753edd47a526b66369a 100644 (file)
@@ -565,7 +565,8 @@ void EditLocallyJob::processLocalItem()
     const auto ok = _folderForFile->journalDb()->getFileRecord(_relativePathToRemoteRoot, &rec);
     Q_ASSERT(ok);
 
-    if (rec.isDirectory()) { // Directories not lock-able
+    // Do not lock if it is a directory or lock is not available on the server
+    if (rec.isDirectory() || !_accountState->account()->capabilities().filesLockAvailable()) {
         openFile();
     } else {
         lockFile();