diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2021-02-12 03:22:52 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2021-02-12 03:22:52 -0500 |
| commit | 48274f33579076711c0475e84c7adf68c52df733 (patch) | |
| tree | 51e564e682430179920b7ab937a5f66c27e0645f /src/moapplication.cpp | |
| parent | 7d36bc20d0a6c327079141149a7f138c0f7726ac (diff) | |
- renamed instance::name() to displayName() to reduce confusion with portable instances
- better errors when running incorrect shortcuts
- fixed shortcuts being created with moshortcut://Portable:exe instead of an empty instance name for portable instances
Diffstat (limited to 'src/moapplication.cpp')
| -rw-r--r-- | src/moapplication.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/moapplication.cpp b/src/moapplication.cpp index 6d21745e..11053e66 100644 --- a/src/moapplication.cpp +++ b/src/moapplication.cpp @@ -392,10 +392,14 @@ void MOApplication::externalMessage(const QString& message) if (moshortcut.isValid()) {
if(moshortcut.hasExecutable()) {
- m_core->processRunner()
- .setFromShortcut(moshortcut)
- .setWaitForCompletion(ProcessRunner::TriggerRefresh)
- .run();
+ try {
+ m_core->processRunner()
+ .setFromShortcut(moshortcut)
+ .setWaitForCompletion(ProcessRunner::TriggerRefresh)
+ .run();
+ } catch(std::exception&) {
+ // user was already warned
+ }
}
} else if (isNxmLink(message)) {
MessageDialog::showMessage(tr("Download started"), qApp->activeWindow(), false);
@@ -414,11 +418,11 @@ void MOApplication::externalMessage(const QString& message) if (auto i=cl.instance()) {
const auto ci = InstanceManager::singleton().currentInstance();
- if (*i != ci->name()) {
+ if (*i != ci->displayName()) {
reportError(tr(
"This shortcut or command line is for instance '%1', but the current "
"instance is '%2'.")
- .arg(*i).arg(ci->name()));
+ .arg(*i).arg(ci->displayName()));
return;
}
|
