summaryrefslogtreecommitdiff
path: root/src/processrunner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/processrunner.cpp')
-rw-r--r--src/processrunner.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/processrunner.cpp b/src/processrunner.cpp
index a0e74f47..bc4e6227 100644
--- a/src/processrunner.cpp
+++ b/src/processrunner.cpp
@@ -586,13 +586,16 @@ ProcessRunner& ProcessRunner::setFromExecutable(const Executable& exe)
ProcessRunner& ProcessRunner::setFromShortcut(const MOShortcut& shortcut)
{
- const auto currentInstance = InstanceManager::instance().currentInstance();
+ const auto currentInstance = InstanceManager::singleton().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());