diff options
author | Be <be@mixxx.org> | 2020-12-05 00:45:38 -0600 |
---|---|---|
committer | Be <be@mixxx.org> | 2020-12-05 01:22:59 -0600 |
commit | 7c385057c66f88b2e82ed9379370cdfa035df5a3 (patch) | |
tree | d608d22e3af2f8e54f274d9ea6b275be1425488d /src | |
parent | 9a555c600267e63eec6da1c24606149bf92bb164 (diff) |
Sandbox: cleanup #ifdefs
Diffstat (limited to 'src')
-rw-r--r-- | src/util/sandbox.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/util/sandbox.cpp b/src/util/sandbox.cpp index 842bd47853..e229a927fa 100644 --- a/src/util/sandbox.cpp +++ b/src/util/sandbox.cpp @@ -30,8 +30,6 @@ void Sandbox::initialize(const QString& permissionsFile) { s_pSandboxPermissions = QSharedPointer<ConfigObject<ConfigValue>>( new ConfigObject<ConfigValue>(permissionsFile)); -#ifdef Q_OS_MAC -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 #ifdef __APPLE__ SecCodeRef secCodeSelf; if (SecCodeCopySelf(kSecCSDefaultFlags, &secCodeSelf) == errSecSuccess) { @@ -48,7 +46,6 @@ void Sandbox::initialize(const QString& permissionsFile) { CFRelease(secCodeSelf); } #endif -#endif } // static @@ -153,8 +150,7 @@ bool Sandbox::createSecurityToken(const QString& canonicalPath, return false; } -#ifdef Q_OS_MAC -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 +#ifdef __APPLE__ CFURLRef url = CFURLCreateWithFileSystemPath( kCFAllocatorDefault, QStringToCFString(canonicalPath), kCFURLPOSIXPathStyle, isDirectory); @@ -189,7 +185,6 @@ bool Sandbox::createSecurityToken(const QString& canonicalPath, } } #endif -#endif return false; } @@ -319,8 +314,7 @@ SecurityTokenPointer Sandbox::openSecurityToken(const QDir& dir, bool create) { SecurityTokenPointer Sandbox::openTokenFromBookmark(const QString& canonicalPath, const QString& bookmarkBase64) { -#ifdef Q_OS_MAC -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 +#ifdef __APPLE__ QByteArray bookmarkBA = QByteArray::fromBase64(bookmarkBase64.toLatin1()); if (!bookmarkBA.isEmpty()) { CFDataRef bookmarkData = CFDataCreate( @@ -357,7 +351,6 @@ SecurityTokenPointer Sandbox::openTokenFromBookmark(const QString& canonicalPath } } } -#endif #else Q_UNUSED(canonicalPath); Q_UNUSED(bookmarkBase64); @@ -366,7 +359,7 @@ SecurityTokenPointer Sandbox::openTokenFromBookmark(const QString& canonicalPath return SecurityTokenPointer(); } -#ifdef Q_OS_MAC +#ifdef __APPLE__ SandboxSecurityToken::SandboxSecurityToken(const QString& path, CFURLRef url) : m_path(path), m_url(url) { @@ -379,16 +372,14 @@ SandboxSecurityToken::SandboxSecurityToken(const QString& path, CFURLRef url) #endif SandboxSecurityToken::~SandboxSecurityToken() { -#ifdef Q_OS_MAC +#ifdef __APPLE__ if (sDebug) { qDebug() << "~SandboxSecurityToken" << m_path; } -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 if (m_url) { CFURLStopAccessingSecurityScopedResource(m_url); CFRelease(m_url); m_url = 0; } #endif -#endif } |