summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl <26797547+Al12rs@users.noreply.github.com>2020-11-28 10:55:25 -0800
committerGitHub <noreply@github.com>2020-11-28 10:55:25 -0800
commit1ec3ab2b8a845f75495b4cacbeb17c86ea137a01 (patch)
treee148056df39a84f4d14269f672f6d82080a22259
parent2c115e48cc42f89250bbca7e2b5b75d5dcad8695 (diff)
parent3db08caaf2a5a52310f3e7decb4d603929c36e9c (diff)
Merge pull request #1304 from ModOrganizer2/Al12rs-refresh-waitForApplication
Refresh after waiting for application (vfs)
-rw-r--r--src/organizerproxy.cpp10
-rw-r--r--src/organizerproxy.h2
2 files changed, 9 insertions, 3 deletions
diff --git a/src/organizerproxy.cpp b/src/organizerproxy.cpp
index c2283acc..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, 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;