From 4e7764f328533e1cc8d8d6851faad70c1d89fe33 Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Sun, 16 Apr 2023 09:57:30 +0200 Subject: [PATCH] Adjust includes/linking for QX11Extras --- plugins/mousepad/CMakeLists.txt | 2 ++ plugins/mousepad/x11remoteinput.cpp | 4 ++++ plugins/notifications/CMakeLists.txt | 10 ++++++---- plugins/notifications/notificationsplugin.cpp | 4 ++++ plugins/virtualmonitor/virtualmonitorplugin.cpp | 1 + 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/plugins/mousepad/CMakeLists.txt b/plugins/mousepad/CMakeLists.txt index 63eb477f7..3a1cc4468 100644 --- a/plugins/mousepad/CMakeLists.txt +++ b/plugins/mousepad/CMakeLists.txt @@ -42,6 +42,8 @@ if(WITH_X11) target_sources(kdeconnect_mousepad PUBLIC x11remoteinput.cpp) if (QT_MAJOR_VERSION EQUAL "5") target_link_libraries(kdeconnect_mousepad Qt5::X11Extras) + elseif(QT_MAJOR_VERSION EQUAL "6") + target_link_libraries(kdeconnect_mousepad Qt6::GuiPrivate) endif() target_link_libraries(kdeconnect_mousepad ${X11_LIBRARIES} ${XTEST_LIBRARIES} ${LibFakeKey_LIBRARIES}) endif() diff --git a/plugins/mousepad/x11remoteinput.cpp b/plugins/mousepad/x11remoteinput.cpp index d81845680..5cd95664a 100644 --- a/plugins/mousepad/x11remoteinput.cpp +++ b/plugins/mousepad/x11remoteinput.cpp @@ -9,7 +9,11 @@ #include #include +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #include +#else +#include +#endif #include #include diff --git a/plugins/notifications/CMakeLists.txt b/plugins/notifications/CMakeLists.txt index 8704704bf..246a3292c 100644 --- a/plugins/notifications/CMakeLists.txt +++ b/plugins/notifications/CMakeLists.txt @@ -24,8 +24,10 @@ target_link_libraries(kdeconnect_notifications KF${QT_MAJOR_VERSION}::WindowSystem ) -if (UNIX AND NOT APPLE AND QT_MAJOR_VERSION EQUAL "5") - target_link_libraries(kdeconnect_notifications - Qt5::X11Extras - ) +if (UNIX AND NOT APPLE) + if (QT_MAJOR_VERSION EQUAL "5") + target_link_libraries(kdeconnect_notifications Qt5::X11Extras) + else() + target_link_libraries(kdeconnect_notifications Qt6::GuiPrivate) + endif() endif() diff --git a/plugins/notifications/notificationsplugin.cpp b/plugins/notifications/notificationsplugin.cpp index ccbb9a56e..fab255cf3 100644 --- a/plugins/notifications/notificationsplugin.cpp +++ b/plugins/notifications/notificationsplugin.cpp @@ -14,7 +14,11 @@ #include #if !defined(Q_OS_WIN) && !defined(Q_OS_MAC) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #include +#else +#include +#endif #endif K_PLUGIN_CLASS_WITH_JSON(NotificationsPlugin, "kdeconnect_notifications.json") diff --git a/plugins/virtualmonitor/virtualmonitorplugin.cpp b/plugins/virtualmonitor/virtualmonitorplugin.cpp index e845aa31e..86db27e93 100644 --- a/plugins/virtualmonitor/virtualmonitorplugin.cpp +++ b/plugins/virtualmonitor/virtualmonitorplugin.cpp @@ -14,6 +14,7 @@ #include #include #include +#include K_PLUGIN_CLASS_WITH_JSON(VirtualMonitorPlugin, "kdeconnect_virtualmonitor.json") #define QS QLatin1String