Skip to content

Commit

Permalink
fix failing tests by using FileSystem::setFileReadOnlyWeak
Browse files Browse the repository at this point in the history
we try to preserve complex existing permissions unless the client is
required to change them significantly

Signed-off-by: Matthieu Gallien <[email protected]>
  • Loading branch information
mgallien committed Jul 11, 2023
1 parent fd37c58 commit ffea7b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libsync/propagatedownload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ void PropagateDownloadFile::downloadFinished()
FileSystem::setFileReadOnly(filename, true);
} else {
qCDebug(lcPropagateDownload()) << "file is not locked: making it 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
Expand Down Expand Up @@ -1353,7 +1353,7 @@ void PropagateDownloadFile::updateMetadata(bool isConflict)
FileSystem::setFileReadOnly(fn, true);
} else {
qCDebug(lcPropagateDownload()) << "file is not locked: making it 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();
Expand Down

0 comments on commit ffea7b3

Please sign in to comment.