SHA256
1
0
forked from pool/kinfocenter5
kinfocenter5/0001-Find-qdbus-command-correctly.patch

86 lines
3.7 KiB
Diff
Raw Normal View History

From 0f19cb4254c5a4a197e5d25f34c4be8de207d6ed Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fabian@ritter-vogt.de>
Date: Sun, 18 Sep 2022 11:49:06 +0200
Subject: [PATCH] Find qdbus command correctly
qdbus is installed into Qt's own binaries dir and might not be in $PATH.
---
CMakeLists.txt | 3 +++
Modules/kwinsupportinfo/CMakeLists.txt | 2 ++
.../{kcm_kwinsupportinfo.json => kcm_kwinsupportinfo.json.in} | 2 +-
Modules/kwinsupportinfo/main.cpp | 3 ++-
4 files changed, 8 insertions(+), 2 deletions(-)
rename Modules/kwinsupportinfo/{kcm_kwinsupportinfo.json => kcm_kwinsupportinfo.json.in} (98%)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c16af497..947688b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,6 +20,7 @@ include(KDEClangFormat)
include(ECMFindQmlModule)
include(KDEGitCommitHooks)
include(ECMSetupQtPluginMacroNames)
+include(ECMQueryQt)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Gui Widgets)
@@ -55,6 +56,8 @@ add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_definitions(-DQT_USE_QSTRINGBUILDER)
+ecm_query_qt(QtBinariesDir QT_INSTALL_BINS)
+
add_subdirectory( Categories )
add_subdirectory( kcontrol/menus )
add_subdirectory( Modules )
diff --git a/Modules/kwinsupportinfo/CMakeLists.txt b/Modules/kwinsupportinfo/CMakeLists.txt
index b5d8a90e..c354475a 100644
--- a/Modules/kwinsupportinfo/CMakeLists.txt
+++ b/Modules/kwinsupportinfo/CMakeLists.txt
@@ -9,4 +9,6 @@ target_link_libraries(kcm_kwinsupportinfo KF5::CoreAddons KF5::QuickAddons KF5::
install(TARGETS kcm_kwinsupportinfo DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/kcms/kinfocenter)
+configure_file(kcm_kwinsupportinfo.json.in ${CMAKE_CURRENT_BINARY_DIR}/kcm_kwinsupportinfo.json @ONLY)
+
kpackage_install_package(package kcm_kwinsupportinfo kcms)
diff --git a/Modules/kwinsupportinfo/kcm_kwinsupportinfo.json b/Modules/kwinsupportinfo/kcm_kwinsupportinfo.json.in
similarity index 98%
rename from Modules/kwinsupportinfo/kcm_kwinsupportinfo.json
rename to Modules/kwinsupportinfo/kcm_kwinsupportinfo.json.in
index 4a8dc422..7fd93ff2 100644
--- a/Modules/kwinsupportinfo/kcm_kwinsupportinfo.json
+++ b/Modules/kwinsupportinfo/kcm_kwinsupportinfo.json.in
@@ -35,6 +35,6 @@
"Name[uk]": "Керування вікнами",
"Name[x-test]": "xxWindow Managerxx"
},
- "TryExec": "qdbus",
+ "TryExec": "@QtBinariesDir@/qdbus",
"X-KDE-KInfoCenter-Category": "graphical_information"
}
diff --git a/Modules/kwinsupportinfo/main.cpp b/Modules/kwinsupportinfo/main.cpp
index e1ca10e9..667c079f 100644
--- a/Modules/kwinsupportinfo/main.cpp
+++ b/Modules/kwinsupportinfo/main.cpp
@@ -8,6 +8,7 @@
#include <KLocalizedString>
#include <KPluginFactory>
#include <KQuickAddons/ConfigModule>
+#include <QLibraryInfo>
#include <CommandOutputContext.h>
@@ -18,7 +19,7 @@ public:
explicit KCMKWinSupportInfo(QObject *parent, const KPluginMetaData &data, const QVariantList &args)
: ConfigModule(parent, data, args)
{
- auto outputContext = new CommandOutputContext(QStringLiteral("qdbus"),
+ auto outputContext = new CommandOutputContext(QLibraryInfo::location(QLibraryInfo::BinariesPath) + QStringLiteral("/qdbus"),
{QStringLiteral("org.kde.KWin"), QStringLiteral("/KWin"), QStringLiteral("supportInformation")},
parent);
qmlRegisterSingletonInstance("org.kde.kinfocenter.kwinsupportinfo.private", 1, 0, "InfoOutputContext", outputContext);
--
2.37.3