use KProcess instead of QProcess to launch apps in ksmserver

Follow-up to the previous commit. KProcess has saner defaults for simply
launching an app and being done with it, no lost stdout/stderr or even SIGPIPE.
CCBUG: 369391
CCBUG: 370528
wilder-5.14
Luboš Luňák 9 years ago
parent da44dd6eae
commit c7d21ae2b8
  1. 5
      ksmserver/startup.cpp

@ -462,8 +462,9 @@ void KSMServer::runUserAutostart()
const QString fullPath = dir.absolutePath() + QLatin1Char('/') + file;
qCInfo(KSMSERVER) << "Starting autostart script " << fullPath;
auto p = new QProcess; //deleted in onFinished lambda
p->start(fullPath);
auto p = new KProcess; //deleted in onFinished lambda
p->setProgram(fullPath);
p->start();
connect(p, static_cast<void (QProcess::*)(int)>(&QProcess::finished), [p](int exitCode) {
qCInfo(KSMSERVER) << "autostart script" << p->program() << "finished with exit code " << exitCode;
p->deleteLater();

Loading…
Cancel
Save