diff --git a/src/libsync/filesystem.cpp b/src/libsync/filesystem.cpp index 8675507d3299..8dbf191b8748 100644 --- a/src/libsync/filesystem.cpp +++ b/src/libsync/filesystem.cpp @@ -273,6 +273,12 @@ bool FileSystem::removeRecursively(const QString &path, const std::function= MAC_OS_X_VERSION_10_15 + const auto fileInfo = QFileInfo{di.filePath()}; + const auto parentFolderPath = fileInfo.dir().absolutePath(); + const auto parentPermissionsHandler = FileSystem::FilePermissionsRestore{parentFolderPath, FileSystem::FolderPermissions::ReadWrite}; +#endif removeOk = FileSystem::remove(di.filePath(), &removeError); if (removeOk) { if (onDeleted) @@ -289,6 +295,12 @@ bool FileSystem::removeRecursively(const QString &path, const std::function= MAC_OS_X_VERSION_10_15 + const auto fileInfo = QFileInfo{path}; + const auto parentFolderPath = fileInfo.dir().absolutePath(); + const auto parentPermissionsHandler = FileSystem::FilePermissionsRestore{parentFolderPath, FileSystem::FolderPermissions::ReadWrite}; + FileSystem::setFolderPermissions(path, FileSystem::FolderPermissions::ReadWrite); +#endif allRemoved = QDir().rmdir(path); if (allRemoved) { if (onDeleted)