From 8f4c2f5c5857ee3c14198f8b59b4928e442eb32a Mon Sep 17 00:00:00 2001 From: Rafael Sadowski Date: Mon, 2 Oct 2017 23:53:28 +0200 Subject: [PATCH 1/3] Fix cmake build on OpenBSD --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From e29d3497eb3f6fa207810d0c0e28f03047175f71 Mon Sep 17 00:00:00 2001 From: Rafael Sadowski Date: Tue, 3 Oct 2017 09:47:33 +0200 Subject: [PATCH 2/3] s/Q_OS_LINUX/Q_OS_UNIX/g Enable support for UNIX like OS. --- src/core/ScreenLockListenerPrivate.cpp | 4 ++-- src/gui/MainWindow.cpp | 4 ++-- src/main.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/ScreenLockListenerPrivate.cpp b/src/core/ScreenLockListenerPrivate.cpp index 36ee301f2..e1e6f3ae6 100644 --- a/src/core/ScreenLockListenerPrivate.cpp +++ b/src/core/ScreenLockListenerPrivate.cpp @@ -19,7 +19,7 @@ #if defined(Q_OS_OSX) #include "ScreenLockListenerMac.h" #endif -#if defined(Q_OS_LINUX) +#if defined(Q_OS_UNIX) #include "ScreenLockListenerDBus.h" #endif #if defined(Q_OS_WIN) @@ -36,7 +36,7 @@ ScreenLockListenerPrivate* ScreenLockListenerPrivate::instance(QWidget* parent) #if defined(Q_OS_OSX) 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..e21c9dd64 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(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(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..90fb68762 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -39,7 +39,7 @@ #ifdef Q_OS_WIN Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) -#elif Q_OS_LINUX +#elif Q_OS_UNIX Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) #endif #endif From 71f38f17cd8c39b5858f33c769455e11e56687d7 Mon Sep 17 00:00:00 2001 From: Janek Bevendorff Date: Wed, 27 Dec 2017 20:31:15 +0100 Subject: [PATCH 3/3] 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