Commit 17c8b6f7 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Improve connect syntax to QProcess

We have better ways to connect than casting nowadays.
parent 5bf83134
Pipeline #180923 passed with stage
in 1 minute and 8 seconds
......@@ -269,7 +269,7 @@ QProcess *PackageKitNotifier::checkAptVariable(const QString &aptconfig, const Q
{
QProcess *process = new QProcess;
process->start(aptconfig, {QStringLiteral("dump")});
connect(process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), this, [func, process, varname](int code) {
connect(process, qOverload<int, QProcess::ExitStatus>(&QProcess::finished), this, [func, process, varname](int code) {
if (code != 0)
return;
......@@ -285,7 +285,7 @@ QProcess *PackageKitNotifier::checkAptVariable(const QString &aptconfig, const Q
}
func({});
});
connect(process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), process, &QObject::deleteLater);
connect(process, qOverload<int, QProcess::ExitStatus>(&QProcess::finished), process, &QObject::deleteLater);
return process;
}
......
......@@ -59,7 +59,7 @@ void SnapTransaction::finishTransaction()
p->setProgram(QStringLiteral(CMAKE_INSTALL_FULL_LIBEXECDIR "/discover/SnapMacaroonDialog"));
p->start();
connect(p, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), this, [this, p](int code, QProcess::ExitStatus status) {
connect(p, qOverload<int, QProcess::ExitStatus>(&QProcess::finished), this, [this, p](int code, QProcess::ExitStatus status) {
p->deleteLater();
if (code != 0) {
qWarning() << "login failed... code:" << code << status << p->readAll();
......
Supports Markdown
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