mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
ensure we can delete invalid read-only items
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
0919bb94cf
commit
240e7fa6b6
@ -1736,7 +1736,16 @@ void Folder::slotNeedToRemoveRemnantsReadOnlyFolders(const QList<SyncFileItemPtr
|
||||
|
||||
setSyncPaused(true);
|
||||
for(const auto &oneFolder : folders) {
|
||||
FileSystem::removeRecursively(localPath + oneFolder->_file);
|
||||
#if !defined(Q_OS_MACOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_15
|
||||
const auto fileInfo = QFileInfo{localPath + oneFolder->_file};
|
||||
const auto parentFolderPath = fileInfo.dir().absolutePath();
|
||||
const auto parentPermissionsHandler = FileSystem::FilePermissionsRestore{parentFolderPath, FileSystem::FolderPermissions::ReadWrite};
|
||||
#endif
|
||||
if (oneFolder->_type == ItemType::ItemTypeDirectory) {
|
||||
FileSystem::removeRecursively(localPath + oneFolder->_file);
|
||||
} else {
|
||||
FileSystem::remove(localPath + oneFolder->_file);
|
||||
}
|
||||
}
|
||||
callback(true);
|
||||
setSyncPaused(false);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user