From 41d9a12e52485d797c463e55794afc9bc4af7c93 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 26 Jun 2024 17:04:17 +0800 Subject: [PATCH] Do not wrap macOS ifdefs in filesystem when parent function already wrapped in ifdef Signed-off-by: Claudio Cambra --- src/libsync/filesystem.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/libsync/filesystem.cpp b/src/libsync/filesystem.cpp index 238c83eb41555..866eccdef12ef 100644 --- a/src/libsync/filesystem.cpp +++ b/src/libsync/filesystem.cpp @@ -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; }