summaryrefslogtreecommitdiff
path: root/src/processrunner.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-12-02 13:51:46 -0500
committerisanae <14251494+isanae@users.noreply.github.com>2019-12-02 13:51:46 -0500
commitd4172dc5f8c642dbbe235a86a28992af310e703a (patch)
tree21eb9f6cc16d9f35cebb2a93c786c17a3a66ea4c /src/processrunner.cpp
parent2b4d7929769a91d9de30e1e10319d1c9cf0450af (diff)
added "open with vfs" option to conflicts tab
Diffstat (limited to 'src/processrunner.cpp')
-rw-r--r--src/processrunner.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/processrunner.cpp b/src/processrunner.cpp
index b6167706..46065d69 100644
--- a/src/processrunner.cpp
+++ b/src/processrunner.cpp
@@ -3,6 +3,8 @@
#include "instancemanager.h"
#include "iuserinterface.h"
#include "envmodule.h"
+#include "env.h"
+#include <iplugingame.h>
#include <log.h>
using namespace MOBase;
@@ -473,13 +475,14 @@ ProcessRunner& ProcessRunner::setWaitForCompletion(
return *this;
}
-ProcessRunner& ProcessRunner::setFromFile(QWidget* parent, const QFileInfo& targetInfo)
+ProcessRunner& ProcessRunner::setFromFile(
+ QWidget* parent, const QFileInfo& targetInfo, bool forceHook)
{
if (!parent && m_ui) {
parent = m_ui->qtWidget();
}
- // if the file is a .exe, start it directory; if it's anything else, ask the
+ // if the file is a .exe, start it directly; if it's anything else, ask the
// shell to start it
const auto fec = spawn::getFileExecutionContext(parent, targetInfo);
@@ -497,6 +500,19 @@ ProcessRunner& ProcessRunner::setFromFile(QWidget* parent, const QFileInfo& targ
case spawn::FileExecutionTypes::Other: // fall-through
default:
{
+ if (forceHook) {
+ auto assoc = env::getAssociation(targetInfo);
+ if (!assoc.executable.filePath().isEmpty()) {
+ setBinary(assoc.executable);
+ setArguments(assoc.formattedCommandLine);
+ setCurrentDirectory(assoc.executable.absoluteDir());
+
+ return *this;
+ }
+
+ // if it fails, just use the regular shell open
+ }
+
m_shellOpen = targetInfo.absoluteFilePath();
// picked up by postRun()