diff --git a/src/libsync/propagatedownload.cpp b/src/libsync/propagatedownload.cpp index 9db454db6c..b4c50e27a7 100644 --- a/src/libsync/propagatedownload.cpp +++ b/src/libsync/propagatedownload.cpp @@ -427,6 +427,12 @@ void PropagateDownloadFile::startAfterIsEncryptedIsChecked() } propagator()->_journal->deleteFileRecord(_item->_originalFile); updateMetadata(false); + + if (!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite)) { + // make sure ReadOnly flag is preserved for placeholder, similarly to regular files + FileSystem::setFileReadOnly(propagator()->fullLocalPath(_item->_file), true); + } + return; } if (vfs->mode() == Vfs::Off && _item->_type == ItemTypeVirtualFile) { @@ -446,6 +452,12 @@ void PropagateDownloadFile::startAfterIsEncryptedIsChecked() return; } updateMetadata(false); + + if (!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite)) { + // make sure ReadOnly flag is preserved for placeholder, similarly to regular files + FileSystem::setFileReadOnly(propagator()->fullLocalPath(_item->_file), true); + } + return; } diff --git a/src/libsync/vfs/cfapi/vfs_cfapi.cpp b/src/libsync/vfs/cfapi/vfs_cfapi.cpp index dcd75d46d0..667e4c82b9 100644 --- a/src/libsync/vfs/cfapi/vfs_cfapi.cpp +++ b/src/libsync/vfs/cfapi/vfs_cfapi.cpp @@ -129,7 +129,7 @@ Result VfsCfApi::dehydratePlaceholder(const SyncFileItem &item) { const auto previousPin = pinState(item._file); - if (!QFile::remove(_setupParams.filesystemPath + item._file)) { + if (!FileSystem::remove(_setupParams.filesystemPath + item._file)) { return QStringLiteral("Couldn't remove %1 to fulfill dehydration").arg(item._file); }