summaryrefslogtreecommitdiffstats
path: root/wayland
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2017-08-13 10:03:12 +0200
committerHolger Freyther <holger+qt@freyther.de>2017-09-12 06:16:55 +0000
commit1b2ca45e95b06e81c0373f7055f31042edcd5530 (patch)
treec05a50121b362aa60cc5659005b5094e76ad8035 /wayland
parentb18b35e2d2db771c754eee9fec7faada2b8fd303 (diff)
democompositor: Log process related events
Use some lambda/closures to keep the process (which would be the sender()) and the appentry around. Change-Id: I2993d31e421a5e03c3b48abd8c1fe4026c4b2899 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'wayland')
-rw-r--r--wayland/democompositor/processlauncher.cpp17
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();