Do not wrap macOS ifdefs in filesystem when parent function already wrapped in ifdef
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 26 Jun 2024 09:04:17 +0000 (17:04 +0800)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Fri, 28 Jun 2024 09:21:39 +0000 (09:21 +0000)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/libsync/filesystem.cpp

index 238c83eb41555e878178d6085db53ab059804dee..866eccdef12efcd2ec854bc82c4b2542ff9beafb 100644 (file)
@@ -328,9 +328,7 @@ bool FileSystem::setFolderPermissions(const QString &path,
         case OCC::FileSystem::FolderPermissions::ReadWrite:
             break;
         }
-    }
-    catch (const std::filesystem::filesystem_error &e)
-    {
+    } catch (const std::filesystem::filesystem_error &e) {
         qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what() << e.path1().c_str() << e.path2().c_str();
         return false;
     }
@@ -453,7 +451,6 @@ bool FileSystem::setFolderPermissions(const QString &path,
     }
 #endif
 
-#if !defined(Q_OS_MACOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_15
     try {
         switch (permissions) {
         case OCC::FileSystem::FolderPermissions::ReadOnly:
@@ -462,13 +459,10 @@ bool FileSystem::setFolderPermissions(const QString &path,
             std::filesystem::permissions(stdStrPath, writePerms, std::filesystem::perm_options::add);
             break;
         }
-    }
-    catch (const std::filesystem::filesystem_error &e)
-    {
+    } catch (const std::filesystem::filesystem_error &e) {
         qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what() << e.path1().c_str() << e.path2().c_str();
         return false;
     }
-#endif
 
     return true;
 }