]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
fix failing tests by using FileSystem::setFileReadOnlyWeak
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Tue, 11 Jul 2023 08:35:34 +0000 (10:35 +0200)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Wed, 12 Jul 2023 11:42:31 +0000 (13:42 +0200)
we try to preserve complex existing permissions unless the client is
required to change them significantly

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/libsync/propagatedownload.cpp

index 93b66526ca9f2948e79508d5f75f16d90788c779..13d1ba58c6975ce93e1aea6b7089604f196be887 100644 (file)
@@ -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();