From bc0fbf137d09a4258e009eb955d87a552071ab7d Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Sat, 25 Jan 2020 22:34:15 +0200 Subject: [PATCH] Port away from a deprecated signal Summary: QProcess::error() has been deprecated since Qt 5.6. It is highly advised to use QProcess::errorOccurred() instead. Test Plan: Compiles. Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D26922 --- keyboard_layout.cpp | 10 ++++------ rules.cpp | 10 ++++------ useractions.cpp | 10 ++++------ xwl/xwayland.cpp | 2 +- 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/keyboard_layout.cpp b/keyboard_layout.cpp index 5a2edc8d19..1a22c54c07 100644 --- a/keyboard_layout.cpp +++ b/keyboard_layout.cpp @@ -269,13 +269,11 @@ void KeyboardLayout::reinitNotifierMenu() p->setProcessEnvironment(kwinApp()->processStartupEnvironment()); p->setProgram(QStringLiteral("kcmshell5")); connect(p, static_cast(&QProcess::finished), p, &QProcess::deleteLater); - connect(p, static_cast(&QProcess::error), this, - [] (QProcess::ProcessError e) { - if (e == QProcess::FailedToStart) { - qCDebug(KWIN_CORE) << "Failed to start kcmshell5"; - } + connect(p, &QProcess::errorOccurred, this, [](QProcess::ProcessError e) { + if (e == QProcess::FailedToStart) { + qCDebug(KWIN_CORE) << "Failed to start kcmshell5"; } - ); + }); p->start(); } ); diff --git a/rules.cpp b/rules.cpp index 843dd40ee9..e610eb11c8 100644 --- a/rules.cpp +++ b/rules.cpp @@ -1051,13 +1051,11 @@ void RuleBook::edit(AbstractClient* c, bool whole_app) p->setProgram(buildDirBinary.exists() ? buildDirBinary.absoluteFilePath() : QStringLiteral(KWIN_RULES_DIALOG_BIN)); p->setProcessChannelMode(QProcess::MergedChannels); connect(p, static_cast(&QProcess::finished), p, &QProcess::deleteLater); - connect(p, static_cast(&QProcess::error), this, - [p] (QProcess::ProcessError e) { - if (e == QProcess::FailedToStart) { - qCDebug(KWIN_CORE) << "Failed to start" << p->program(); - } + connect(p, &QProcess::errorOccurred, this, [p](QProcess::ProcessError e) { + if (e == QProcess::FailedToStart) { + qCDebug(KWIN_CORE) << "Failed to start" << p->program(); } - ); + }); p->start(); } diff --git a/useractions.cpp b/useractions.cpp index 54f4827c04..cdae431175 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -327,13 +327,11 @@ void UserActionsMenu::init() p->setProcessEnvironment(kwinApp()->processStartupEnvironment()); p->setProgram(QStringLiteral("kcmshell5")); connect(p, static_cast(&QProcess::finished), p, &QProcess::deleteLater); - connect(p, static_cast(&QProcess::error), this, - [p] (QProcess::ProcessError e) { - if (e == QProcess::FailedToStart) { - qCDebug(KWIN_CORE) << "Failed to start kcmshell5"; - } + connect(p, &QProcess::errorOccurred, this, [p](QProcess::ProcessError e) { + if (e == QProcess::FailedToStart) { + qCDebug(KWIN_CORE) << "Failed to start kcmshell5"; } - ); + }); p->start(); } ); diff --git a/xwl/xwayland.cpp b/xwl/xwayland.cpp index 5f17d3923c..276a102378 100644 --- a/xwl/xwayland.cpp +++ b/xwl/xwayland.cpp @@ -155,7 +155,7 @@ void Xwayland::init() QStringLiteral("-rootless"), QStringLiteral("-wm"), QString::number(fd)}); - m_xwaylandFailConnection = connect(m_xwaylandProcess, static_cast(&QProcess::error), this, + m_xwaylandFailConnection = connect(m_xwaylandProcess, &QProcess::errorOccurred, this, [this] (QProcess::ProcessError error) { if (error == QProcess::FailedToStart) { std::cerr << "FATAL ERROR: failed to start Xwayland" << std::endl;