diff options
-rw-r--r-- | wayland/democompositor/processlauncher.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/wayland/democompositor/processlauncher.cpp b/wayland/democompositor/processlauncher.cpp index f0e465e..40b3b8b 100644 --- a/wayland/democompositor/processlauncher.cpp +++ b/wayland/democompositor/processlauncher.cpp @@ -69,9 +69,22 @@ void WaylandProcessLauncher::launch(const AppEntry &entry) qCDebug(procs) << "Launching" << entry.executableName; QProcess *process = new QProcess(this); + + /* handle potential errors and life cycle */ connect(process, static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), - process, &QProcess::deleteLater); - connect(process, &QProcess::errorOccurred, &QProcess::deleteLater); + [process, entry](int exitCode, QProcess::ExitStatus status) { + qCDebug(procs) << "AppEntry finished" << entry.executableName << exitCode << status; + process->deleteLater(); + }); + connect(process, &QProcess::errorOccurred, + [process, entry](QProcess::ProcessError err) { + qCDebug(procs) << "AppEntry error occurred" << entry.executableName << err; + process->deleteLater(); + }); + connect(process, &QProcess::started, + [process, entry]() { + qCDebug(procs) << "AppEntry started" << entry.executableName; + }); if (!entry.executablePath.isNull()) { auto env = QProcessEnvironment::systemEnvironment(); |