summaryrefslogtreecommitdiff
path: root/src/processrunner.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2020-11-03 10:57:26 -0500
committerisanae <14251494+isanae@users.noreply.github.com>2020-11-03 11:41:54 -0500
commit1d97d914f1de0404b5b4db1bfdeff35ed94ea422 (patch)
treec1f7514c450a3957613830ef26d618dd5c6f863e /src/processrunner.cpp
parentb10436d60f7db3eedd838cbfad93cb41ddf1fd86 (diff)
InstanceManager now returns new Instance struct instead of instance name
moved most of the figuring out of instance parameters from InstanceManager to Instance, separated all the ui from it and put it in main.cpp added ways to show single pages in the create instance dialog so they can be used when info is missing
Diffstat (limited to 'src/processrunner.cpp')
-rw-r--r--src/processrunner.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/processrunner.cpp b/src/processrunner.cpp
index a0e74f47..8ee0914b 100644
--- a/src/processrunner.cpp
+++ b/src/processrunner.cpp
@@ -588,11 +588,14 @@ ProcessRunner& ProcessRunner::setFromShortcut(const MOShortcut& shortcut)
{
const auto currentInstance = InstanceManager::instance().currentInstance();
- if (shortcut.hasInstance() && shortcut.instance() != currentInstance) {
- throw std::runtime_error(
- QString("Refusing to run executable from different instance %1:%2")
- .arg(shortcut.instance(),shortcut.executable())
- .toLocal8Bit().constData());
+ if (currentInstance)
+ {
+ if (shortcut.hasInstance() && shortcut.instance() != currentInstance->name()) {
+ throw std::runtime_error(
+ QString("Refusing to run executable from different instance %1:%2")
+ .arg(shortcut.instance(),shortcut.executable())
+ .toLocal8Bit().constData());
+ }
}
const Executable& exe = m_core.executablesList()->get(shortcut.executable());