diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 216db839e..00d628aca 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -161,7 +161,7 @@ if(APPLE) core/MacPasteboard.cpp ) endif() -if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") +if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") set(keepassx_SOURCES ${keepassx_SOURCES} core/ScreenLockListenerDBus.h core/ScreenLockListenerDBus.cpp diff --git a/src/core/ScreenLockListenerPrivate.cpp b/src/core/ScreenLockListenerPrivate.cpp index 36ee301f2..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_LINUX) +#elif defined(Q_OS_UNIX) #include "ScreenLockListenerDBus.h" -#endif -#if defined(Q_OS_WIN) +#elif defined(Q_OS_WIN) #include "ScreenLockListenerWin.h" #endif @@ -33,10 +31,10 @@ 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_LINUX) +#elif defined(Q_OS_UNIX) return new ScreenLockListenerDBus(parent); #elif defined(Q_OS_WIN) return new ScreenLockListenerWin(parent); diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index d63545bf1..08840cdb0 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -23,7 +23,7 @@ #include #include -#if defined(Q_OS_LINUX) && ! 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_LINUX) && ! 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 7977435fc..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_LINUX +#elif defined(Q_OS_UNIX) && !defined(Q_OS_MAC) Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) #endif #endif