diff options
| author | AL <26797547+Al12rs@users.noreply.github.com> | 2020-11-28 17:28:49 +0100 |
|---|---|---|
| committer | AL <26797547+Al12rs@users.noreply.github.com> | 2020-11-28 17:28:49 +0100 |
| commit | 3db08caaf2a5a52310f3e7decb4d603929c36e9c (patch) | |
| tree | e148056df39a84f4d14269f672f6d82080a22259 /src | |
| parent | d99e576db8913af8ff864fcce9f67f51be252e99 (diff) | |
Allow optional refresh for waitForApplication()
Diffstat (limited to 'src')
| -rw-r--r-- | src/organizerproxy.cpp | 10 | ||||
| -rw-r--r-- | src/organizerproxy.h | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/organizerproxy.cpp b/src/organizerproxy.cpp index 06e932cb..92f250ea 100644 --- a/src/organizerproxy.cpp +++ b/src/organizerproxy.cpp @@ -144,7 +144,7 @@ HANDLE OrganizerProxy::startApplication( return runner.stealProcessHandle().release();
}
-bool OrganizerProxy::waitForApplication(HANDLE handle, LPDWORD exitCode) const
+bool OrganizerProxy::waitForApplication(HANDLE handle, bool refresh, LPDWORD exitCode) const
{
const auto pid = ::GetProcessId(handle);
@@ -154,8 +154,14 @@ bool OrganizerProxy::waitForApplication(HANDLE handle, LPDWORD exitCode) const auto runner = m_Proxied->processRunner();
+ ProcessRunner::WaitFlags waitFlags = ProcessRunner::ForceWait;
+
+ if (refresh) {
+ waitFlags |= ProcessRunner::Refresh;
+ }
+
const auto r = runner
- .setWaitForCompletion(ProcessRunner::ForceWait | ProcessRunner::Refresh, UILocker::OutputRequired)
+ .setWaitForCompletion(waitFlags, UILocker::OutputRequired)
.attachToProcess(handle);
if (exitCode) {
diff --git a/src/organizerproxy.h b/src/organizerproxy.h index 8664c64f..3097adf0 100644 --- a/src/organizerproxy.h +++ b/src/organizerproxy.h @@ -52,7 +52,7 @@ public: virtual MOBase::IProfile *profile() const override;
virtual HANDLE startApplication(const QString &executable, const QStringList &args = QStringList(), const QString &cwd = "",
const QString &profile = "", const QString &forcedCustomOverwrite = "", bool ignoreCustomOverwrite = false);
- virtual bool waitForApplication(HANDLE handle, LPDWORD exitCode = nullptr) const;
+ virtual bool waitForApplication(HANDLE handle, bool refresh = true, LPDWORD exitCode = nullptr) const;
virtual void refresh(bool saveChanges);
virtual bool onAboutToRun(const std::function<bool(const QString&)> &func) override;
|
