From 42cae2c5f1c02c63d3ff42c665c734dc6d0bedc1 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Tue, 26 Nov 2024 18:12:36 +0100 Subject: [PATCH] when updating a virtual file after lock/unlock: avoid setting modtime 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 --- src/gui/folder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index e35be0168f82d..a2547dafafa69 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -666,7 +666,7 @@ void Folder::slotFilesLockReleased(const QSet &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 &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); } } }