From 845c66666e68849a5ca4ca3ec0ec404d278c886e Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Tue, 11 Jul 2023 10:35:34 +0200 Subject: [PATCH] fix failing tests by using FileSystem::setFileReadOnlyWeak we try to preserve complex existing permissions unless the client is required to change them significantly Signed-off-by: Matthieu Gallien --- src/libsync/propagatedownload.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsync/propagatedownload.cpp b/src/libsync/propagatedownload.cpp index 93b66526ca9f2..13d1ba58c6975 100644 --- a/src/libsync/propagatedownload.cpp +++ b/src/libsync/propagatedownload.cpp @@ -1205,7 +1205,7 @@ void PropagateDownloadFile::downloadFinished() qCDebug(lcPropagateDownload()) << _tmpFile << "file is not locked: making it" << ((!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite)) ? "read only" : "read write"); - FileSystem::setFileReadOnly(filename, (!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite))); + FileSystem::setFileReadOnlyWeak(filename, (!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite))); } // Apply the remote permissions @@ -1355,7 +1355,7 @@ void PropagateDownloadFile::updateMetadata(bool isConflict) FileSystem::setFileReadOnly(fn, true); } else { qCDebug(lcPropagateDownload()) << fn << "file is not locked: making it" << ((!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite)) ? "read only" : "read write"); - FileSystem::setFileReadOnly(fn, (!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite))); + FileSystem::setFileReadOnlyWeak(fn, (!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite))); } qint64 duration = _stopwatch.elapsed();