summaryrefslogtreecommitdiff
path: root/src/organizerproxy.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-10-31 03:54:18 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-11-06 07:44:59 -0500
commitd72e94a92f31bcc720d12ed0cb2cc75b590e6770 (patch)
treedb195349495d6f6baa34273f0c38d8845cec49ec /src/organizerproxy.cpp
parenta88f9dd9a703c23263b5561d3cae126e90e36f3f (diff)
added attachToProcess(), made waitForApplication() private
changed OrganizerProxy::startApplication() so it _doesn't_ wait for completion, which is its original behaviour
Diffstat (limited to 'src/organizerproxy.cpp')
-rw-r--r--src/organizerproxy.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/organizerproxy.cpp b/src/organizerproxy.cpp
index 9de5b4ba..0b6f8df1 100644
--- a/src/organizerproxy.cpp
+++ b/src/organizerproxy.cpp
@@ -123,9 +123,9 @@ HANDLE OrganizerProxy::startApplication(
auto runner = m_Proxied->processRunner();
+ // don't wait for completion
runner
.setFromFileOrExecutable(exe, args, cwd, profile, overwrite, ignoreOverwrite)
- .setWaitForCompletion(ProcessRunner::Refresh)
.run();
return runner.processHandle();
@@ -139,8 +139,15 @@ bool OrganizerProxy::waitForApplication(HANDLE handle, LPDWORD exitCode) const
"a plugin wants to wait for an application to complete, pid {}{}",
pid, (pid == 0 ? "unknown (probably already completed)" : ""));
- const auto r = m_Proxied->processRunner().waitForApplication(
- handle, exitCode, LockWidget::OutputRequired);
+ auto runner = m_Proxied->processRunner();
+
+ const auto r = runner
+ .setWaitForCompletion(ProcessRunner::NoRefresh, LockWidget::OutputRequired)
+ .attachToProcess(handle);
+
+ if (exitCode) {
+ *exitCode = runner.exitCode();
+ }
switch (r)
{