diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-11-06 10:51:03 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-06 10:51:03 -0500 |
| commit | b909677c3fc6a7b7a1993d341a2bd420715e292a (patch) | |
| tree | 8a883011d5e207c31edf9b94ee67bff1827c2ddf /src/processrunner.cpp | |
| parent | a63a27840bfa7b08f295bfe682ebc33d70a613b9 (diff) | |
| parent | ad8e9d99b30578676c15d10a74f010439e132406 (diff) | |
Merge pull request #1280 from isanae/command-line
Command line and instance dialogs
Diffstat (limited to 'src/processrunner.cpp')
| -rw-r--r-- | src/processrunner.cpp | 15 |
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()); |
