summaryrefslogtreecommitdiff
path: root/src/organizerproxy.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-10-31 02:52:14 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-11-06 07:44:59 -0500
commita88f9dd9a703c23263b5561d3cae126e90e36f3f (patch)
tree48a76a1e24be932ee4056c2008ce4c01d5092810 /src/organizerproxy.cpp
parentb855754c9708c825e6bc1e995cb0262c065c5d20 (diff)
removed runExecutableOrExecutableFile()
log the actual spawning and requests to start as well as wait from plugins raise the lock widget when it's a dialog
Diffstat (limited to 'src/organizerproxy.cpp')
-rw-r--r--src/organizerproxy.cpp32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/organizerproxy.cpp b/src/organizerproxy.cpp
index 3ee35fe2..9de5b4ba 100644
--- a/src/organizerproxy.cpp
+++ b/src/organizerproxy.cpp
@@ -108,17 +108,37 @@ QString OrganizerProxy::pluginDataPath() const
}
HANDLE OrganizerProxy::startApplication(
- const QString &executable, const QStringList &args, const QString &cwd,
- const QString &profile, const QString &forcedCustomOverwrite,
- bool ignoreCustomOverwrite)
+ const QString& exe, const QStringList& args, const QString &cwd,
+ const QString& profile, const QString &overwrite, bool ignoreOverwrite)
{
- return m_Proxied->processRunner().runExecutableOrExecutableFile(
- executable, args, cwd, profile,
- forcedCustomOverwrite, ignoreCustomOverwrite);
+ log::debug(
+ "a plugin has requested to start an application:\n"
+ " . executable: '{}'\n"
+ " . args: '{}'\n"
+ " . cwd: '{}'\n"
+ " . profile: '{}'\n"
+ " . overwrite: '{}'\n"
+ " . ignore overwrite: {}",
+ exe, args.join(" "), cwd, profile, overwrite, ignoreOverwrite);
+
+ auto runner = m_Proxied->processRunner();
+
+ runner
+ .setFromFileOrExecutable(exe, args, cwd, profile, overwrite, ignoreOverwrite)
+ .setWaitForCompletion(ProcessRunner::Refresh)
+ .run();
+
+ return runner.processHandle();
}
bool OrganizerProxy::waitForApplication(HANDLE handle, LPDWORD exitCode) const
{
+ const auto pid = ::GetProcessId(handle);
+
+ log::debug(
+ "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);