Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 97beb72d authored by Martin Flöser's avatar Martin Flöser

Support starting the rules_dialog from build dir

Summary:
As with all libexec executables we first need to test whether the binary
is available in the application's directory and start this, otherwise
the system wide installed one.

See: https://community.kde.org/Guidelines_and_HOWTOs/Making_apps_run_uninstalled

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16765
parent bf19c41b
......@@ -28,6 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QFile>
#include <QFileInfo>
#include <QDebug>
#include <QDir>
#ifndef KCMRULES
#include "client.h"
......@@ -1047,7 +1048,8 @@ void RuleBook::edit(AbstractClient* c, bool whole_app)
QProcess *p = new Process(this);
p->setArguments(args);
p->setProcessEnvironment(kwinApp()->processStartupEnvironment());
p->setProgram(QStringLiteral(KWIN_RULES_DIALOG_BIN));
const QFileInfo buildDirBinary{QDir{QCoreApplication::applicationDirPath()}, QStringLiteral("kwin_rules_dialog")};
p->setProgram(buildDirBinary.exists() ? buildDirBinary.absoluteFilePath() : QStringLiteral(KWIN_RULES_DIALOG_BIN));
connect(p, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), p, &QProcess::deleteLater);
connect(p, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error), this,
[p] (QProcess::ProcessError e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment