mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
when deleting a folder starts by making it read-write permissions
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
bf1a13913a
commit
b97f7eb84c
@ -259,6 +259,8 @@ qint64 FileSystem::getSize(const QString &filename)
|
||||
// Code inspired from Qt5's QDir::removeRecursively
|
||||
bool FileSystem::removeRecursively(const QString &path, const std::function<void(const QString &path, bool isDir)> &onDeleted, QStringList *errors)
|
||||
{
|
||||
FileSystem::setFolderPermissions(path, FileSystem::FolderPermissions::ReadWrite);
|
||||
|
||||
bool allRemoved = true;
|
||||
QDirIterator di(path, QDir::AllEntries | QDir::Hidden | QDir::System | QDir::NoDotAndDotDot);
|
||||
|
||||
|
||||
@ -63,7 +63,6 @@ bool PropagateLocalRemove::removeRecursively(const QString &path)
|
||||
const auto fileInfo = QFileInfo{absolute};
|
||||
const auto parentFolderPath = fileInfo.dir().absolutePath();
|
||||
const auto parentPermissionsHandler = FileSystem::FilePermissionsRestore{parentFolderPath, FileSystem::FolderPermissions::ReadWrite};
|
||||
FileSystem::setFolderPermissions(absolute, FileSystem::FolderPermissions::ReadWrite);
|
||||
bool success = FileSystem::removeRecursively(
|
||||
absolute,
|
||||
[&deleted](const QString &path, bool isDir) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user