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
This commit is contained in:
Vlad Zahorodnii 2020-01-25 22:34:15 +02:00
parent 491d78ec40
commit bc0fbf137d
4 changed files with 13 additions and 19 deletions

View file

@ -269,13 +269,11 @@ void KeyboardLayout::reinitNotifierMenu()
p->setProcessEnvironment(kwinApp()->processStartupEnvironment()); p->setProcessEnvironment(kwinApp()->processStartupEnvironment());
p->setProgram(QStringLiteral("kcmshell5")); p->setProgram(QStringLiteral("kcmshell5"));
connect(p, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), p, &QProcess::deleteLater); 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, connect(p, &QProcess::errorOccurred, this, [](QProcess::ProcessError e) {
[] (QProcess::ProcessError e) { if (e == QProcess::FailedToStart) {
if (e == QProcess::FailedToStart) { qCDebug(KWIN_CORE) << "Failed to start kcmshell5";
qCDebug(KWIN_CORE) << "Failed to start kcmshell5";
}
} }
); });
p->start(); p->start();
} }
); );

View file

@ -1051,13 +1051,11 @@ void RuleBook::edit(AbstractClient* c, bool whole_app)
p->setProgram(buildDirBinary.exists() ? buildDirBinary.absoluteFilePath() : QStringLiteral(KWIN_RULES_DIALOG_BIN)); p->setProgram(buildDirBinary.exists() ? buildDirBinary.absoluteFilePath() : QStringLiteral(KWIN_RULES_DIALOG_BIN));
p->setProcessChannelMode(QProcess::MergedChannels); p->setProcessChannelMode(QProcess::MergedChannels);
connect(p, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), p, &QProcess::deleteLater); 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, connect(p, &QProcess::errorOccurred, this, [p](QProcess::ProcessError e) {
[p] (QProcess::ProcessError e) { if (e == QProcess::FailedToStart) {
if (e == QProcess::FailedToStart) { qCDebug(KWIN_CORE) << "Failed to start" << p->program();
qCDebug(KWIN_CORE) << "Failed to start" << p->program();
}
} }
); });
p->start(); p->start();
} }

View file

@ -327,13 +327,11 @@ void UserActionsMenu::init()
p->setProcessEnvironment(kwinApp()->processStartupEnvironment()); p->setProcessEnvironment(kwinApp()->processStartupEnvironment());
p->setProgram(QStringLiteral("kcmshell5")); p->setProgram(QStringLiteral("kcmshell5"));
connect(p, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), p, &QProcess::deleteLater); 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, connect(p, &QProcess::errorOccurred, this, [p](QProcess::ProcessError e) {
[p] (QProcess::ProcessError e) { if (e == QProcess::FailedToStart) {
if (e == QProcess::FailedToStart) { qCDebug(KWIN_CORE) << "Failed to start kcmshell5";
qCDebug(KWIN_CORE) << "Failed to start kcmshell5";
}
} }
); });
p->start(); p->start();
} }
); );

View file

@ -155,7 +155,7 @@ void Xwayland::init()
QStringLiteral("-rootless"), QStringLiteral("-rootless"),
QStringLiteral("-wm"), QStringLiteral("-wm"),
QString::number(fd)}); QString::number(fd)});
m_xwaylandFailConnection = connect(m_xwaylandProcess, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error), this, m_xwaylandFailConnection = connect(m_xwaylandProcess, &QProcess::errorOccurred, this,
[this] (QProcess::ProcessError error) { [this] (QProcess::ProcessError error) {
if (error == QProcess::FailedToStart) { if (error == QProcess::FailedToStart) {
std::cerr << "FATAL ERROR: failed to start Xwayland" << std::endl; std::cerr << "FATAL ERROR: failed to start Xwayland" << std::endl;