removeOk = removeRecursively(path + QLatin1Char('/') + di.fileName(), onDeleted, errors); // recursive
} else {
QString removeError;
+
+#if !defined(Q_OS_MACOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 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)
allRemoved = false;
}
if (allRemoved) {
+#if !defined(Q_OS_MACOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 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)