From 71f38f17cd8c39b5858f33c769455e11e56687d7 Mon Sep 17 00:00:00 2001 From: Janek Bevendorff Date: Wed, 27 Dec 2017 20:31:15 +0100 Subject: [PATCH] Restrict Q_OS_UNIX ifdefs to non-Mac platforms --- src/core/ScreenLockListenerPrivate.cpp | 10 ++++------ src/gui/MainWindow.cpp | 4 ++-- src/main.cpp | 4 ++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/core/ScreenLockListenerPrivate.cpp b/src/core/ScreenLockListenerPrivate.cpp index e1e6f3ae6..b36b9a33a 100644 --- a/src/core/ScreenLockListenerPrivate.cpp +++ b/src/core/ScreenLockListenerPrivate.cpp @@ -16,13 +16,11 @@ */ #include "ScreenLockListenerPrivate.h" -#if defined(Q_OS_OSX) +#if defined(Q_OS_MAC) #include "ScreenLockListenerMac.h" -#endif -#if defined(Q_OS_UNIX) +#elif defined(Q_OS_UNIX) #include "ScreenLockListenerDBus.h" -#endif -#if defined(Q_OS_WIN) +#elif defined(Q_OS_WIN) #include "ScreenLockListenerWin.h" #endif @@ -33,7 +31,7 @@ ScreenLockListenerPrivate::ScreenLockListenerPrivate(QWidget* parent) ScreenLockListenerPrivate* ScreenLockListenerPrivate::instance(QWidget* parent) { -#if defined(Q_OS_OSX) +#if defined(Q_OS_MAC) Q_UNUSED(parent); return ScreenLockListenerMac::instance(); #elif defined(Q_OS_UNIX) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index e21c9dd64..08840cdb0 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -23,7 +23,7 @@ #include #include -#if defined(Q_OS_UNIX) && !defined(QT_NO_DBUS) +#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(QT_NO_DBUS) #include #include #endif @@ -888,7 +888,7 @@ void MainWindow::toggleWindow() raise(); activateWindow(); -#if defined(Q_OS_UNIX) && !defined(QT_NO_DBUS) && (QT_VERSION < QT_VERSION_CHECK(5, 9, 0)) +#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(QT_NO_DBUS) && (QT_VERSION < QT_VERSION_CHECK(5, 9, 0)) // re-register global D-Bus menu (needed on Ubuntu with Unity) // see https://github.com/keepassxreboot/keepassxc/issues/271 // and https://bugreports.qt.io/browse/QTBUG-58723 diff --git a/src/main.cpp b/src/main.cpp index 90fb68762..c3b1c6987 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -37,9 +37,9 @@ #ifdef QT_STATIC #include -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) -#elif Q_OS_UNIX +#elif defined(Q_OS_UNIX) && !defined(Q_OS_MAC) Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) #endif #endif