fix(PinState): don't trigger sync when file's PinState changed to Unspecified.

LibreOffice/Microsoft office might touch the files for unknown reasons,
creating a constant sync state (icon) visible in the parent folder.

This fix excludes PinState changes from a new sync if the trigger
might have been an external application.

Signed-off-by: Camila Ayres <hello@camilasan.com>
This commit is contained in:
Camila Ayres 2025-04-03 19:10:15 +02:00 committed by backportbot[bot]
parent 5fbafd458a
commit 38b71912fb

View File

@ -652,8 +652,11 @@ void Folder::slotWatchedPathChanged(const QStringView &path, const ChangeReason
if (record.isValid()
&& !FileSystem::fileChanged(path.toString(), record._fileSize, record._modtime) && _vfs) {
spurious = true;
if (auto pinState = _vfs->pinState(relativePath.toString())) {
qCDebug(lcFolder) << "PinState for" << relativePath << "is" << *pinState;
if (*pinState == PinState::Unspecified) {
spurious = false;
}
if (*pinState == PinState::AlwaysLocal && record.isVirtualFile()) {
spurious = false;
}