Skip to content

Commit

Permalink
when updating a virtual file after lock/unlock: avoid setting modtime
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mgallien committed Nov 26, 2024
1 parent f760f51 commit 6b1d538
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 6b1d538

Please sign in to comment.