Pantheon updates 2024-12-13 (#364951)
[NixPkgs.git] / pkgs / development / libraries / kde-frameworks / kdesu / kdesu-search-for-wrapped-daemon-first.patch
blob1379707f02fe0d26b64be92b03b3742aed7dcbc9
1 From 01af4d2a098e5819c09bca37568941dcd4b89d0b Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= <malaquias@gmail.com>
3 Date: Thu, 16 Jul 2020 13:21:42 -0300
4 Subject: [PATCH] Search for the daemon first in /run/wrappers/bin
6 If looking first in libexec, the eventually wrapped one in
7 /run/wrappers/bin can not be found.
8 ---
9 src/client.cpp | 13 ++++++++-----
10 1 file changed, 8 insertions(+), 5 deletions(-)
12 diff --git a/src/client.cpp b/src/client.cpp
13 index 44fbacd..6b5abf5 100644
14 --- a/src/client.cpp
15 +++ b/src/client.cpp
16 @@ -384,11 +384,14 @@ int KDEsuClient::stopServer()
18 static QString findDaemon()
20 - QString daemon = QFile::decodeName(KDE_INSTALL_FULL_LIBEXECDIR_KF "/kdesud");
21 - if (!QFile::exists(daemon)) { // if not in libexec, find it in PATH
22 - daemon = QStandardPaths::findExecutable(QStringLiteral("kdesud"));
23 - if (daemon.isEmpty()) {
24 - qCWarning(KSU_LOG) << "kdesud daemon not found.";
25 + QString daemon = QFile::decodeName("/run/wrappers/bin/kdesud");
26 + if (!QFile::exists(daemon)) { // if not in wrappers
27 + daemon = QFile::decodeName(KDE_INSTALL_FULL_LIBEXECDIR_KF "/kdesud");
28 + if (!QFile::exists(daemon)) { // if not in libexec, find it in PATH
29 + daemon = QStandardPaths::findExecutable(QStringLiteral("kdesud"));
30 + if (daemon.isEmpty()) {
31 + qCWarning(KSU_LOG) << "kdesud daemon not found.";
32 + }
35 return daemon;
36 --
37 2.27.0