when updating a virtual file after lock/unlock: avoid setting modtime
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Tue, 26 Nov 2024 17:12:36 +0000 (18:12 +0100)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Fri, 29 Nov 2024 11:11:20 +0000 (12:11 +0100)
will prevent truncating the modification time when changing the lock
state of a file

could be visible when using an office software to open an office file
with automated locking happening after the file gets opened

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/gui/folder.cpp

index e35be0168f82d68218f5caad628a45974af97fda..a2547dafafa69e14e78b1c9aac71cbdbabd8d0d7 100644 (file)
@@ -666,7 +666,7 @@ void Folder::slotFilesLockReleased(const QSet<QString> &files)
         SyncJournalFileRecord rec;
         const auto isFileRecordValid = journalDb()->getFileRecord(fileRecordPath, &rec) && rec.isValid();
         if (isFileRecordValid) {
-            [[maybe_unused]] const auto result = _vfs->updateMetadata(path() + rec.path(), rec._modtime, rec._fileSize, rec._fileId);
+            [[maybe_unused]] const auto result = _vfs->updatePlaceholderMarkInSync(path() + rec.path(), rec._fileId);
         }
         const auto canUnlockFile = isFileRecordValid
             && rec._lockstate._locked
@@ -709,7 +709,7 @@ void Folder::slotFilesLockImposed(const QSet<QString> &files)
         const auto fileRecordPath = fileFromLocalPath(file);
         SyncJournalFileRecord rec;
         if (journalDb()->getFileRecord(fileRecordPath, &rec) && rec.isValid()) {
-            [[maybe_unused]] const auto result = _vfs->updateMetadata(path() + rec.path(), rec._modtime, rec._fileSize, rec._fileId);
+            [[maybe_unused]] const auto result = _vfs->updatePlaceholderMarkInSync(path() + rec.path(), rec._fileId);
         }
     }
 }