Restrict Q_OS_UNIX ifdefs to non-Mac platforms

This commit is contained in:
Janek Bevendorff 2017-12-27 20:31:15 +01:00
parent e29d3497eb
commit 71f38f17cd
3 changed files with 8 additions and 10 deletions

View File

@ -16,13 +16,11 @@
*/ */
#include "ScreenLockListenerPrivate.h" #include "ScreenLockListenerPrivate.h"
#if defined(Q_OS_OSX) #if defined(Q_OS_MAC)
#include "ScreenLockListenerMac.h" #include "ScreenLockListenerMac.h"
#endif #elif defined(Q_OS_UNIX)
#if defined(Q_OS_UNIX)
#include "ScreenLockListenerDBus.h" #include "ScreenLockListenerDBus.h"
#endif #elif defined(Q_OS_WIN)
#if defined(Q_OS_WIN)
#include "ScreenLockListenerWin.h" #include "ScreenLockListenerWin.h"
#endif #endif
@ -33,7 +31,7 @@ ScreenLockListenerPrivate::ScreenLockListenerPrivate(QWidget* parent)
ScreenLockListenerPrivate* ScreenLockListenerPrivate::instance(QWidget* parent) ScreenLockListenerPrivate* ScreenLockListenerPrivate::instance(QWidget* parent)
{ {
#if defined(Q_OS_OSX) #if defined(Q_OS_MAC)
Q_UNUSED(parent); Q_UNUSED(parent);
return ScreenLockListenerMac::instance(); return ScreenLockListenerMac::instance();
#elif defined(Q_OS_UNIX) #elif defined(Q_OS_UNIX)

View File

@ -23,7 +23,7 @@
#include <QShortcut> #include <QShortcut>
#include <QTimer> #include <QTimer>
#if defined(Q_OS_UNIX) && !defined(QT_NO_DBUS) #if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(QT_NO_DBUS)
#include <QList> #include <QList>
#include <QtDBus/QtDBus> #include <QtDBus/QtDBus>
#endif #endif
@ -888,7 +888,7 @@ void MainWindow::toggleWindow()
raise(); raise();
activateWindow(); 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) // re-register global D-Bus menu (needed on Ubuntu with Unity)
// see https://github.com/keepassxreboot/keepassxc/issues/271 // see https://github.com/keepassxreboot/keepassxc/issues/271
// and https://bugreports.qt.io/browse/QTBUG-58723 // and https://bugreports.qt.io/browse/QTBUG-58723

View File

@ -37,9 +37,9 @@
#ifdef QT_STATIC #ifdef QT_STATIC
#include <QtPlugin> #include <QtPlugin>
#ifdef Q_OS_WIN #if defined(Q_OS_WIN)
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
#elif Q_OS_UNIX #elif defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)
#endif #endif
#endif #endif