mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
fix(delete): fix move to trash when parent folder is read-only
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
584c81321f
commit
db58703fc0
@ -101,6 +101,9 @@ void PropagateLocalRemove::start()
|
||||
if (_moveToTrash && propagator()->syncOptions()._vfs->mode() != OCC::Vfs::WindowsCfApi) {
|
||||
const auto fileInfo = QFileInfo{filename};
|
||||
if (FileSystem::fileExists(filename, fileInfo)) {
|
||||
const auto parentFolderPath = fileInfo.dir().absolutePath();
|
||||
const auto parentPermissionsHandler = FileSystem::FilePermissionsRestore{parentFolderPath, FileSystem::FolderPermissions::ReadWrite};
|
||||
|
||||
if (!FileSystem::moveToTrash(filename, &removeError)) {
|
||||
qCWarning(lcPropagateLocalRemove()) << "move to trash failed" << filename << removeError;
|
||||
done(SyncFileItem::NormalError, tr("Temporary error when removing local item removed from server."), ErrorCategory::GenericError);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user