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/commandline.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/commandline.cpp')
| -rw-r--r-- | src/commandline.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/commandline.cpp b/src/commandline.cpp index 22755dda..f64ff7cb 100644 --- a/src/commandline.cpp +++ b/src/commandline.cpp @@ -251,7 +251,7 @@ std::optional<int> CommandLine::runPostApplication(MOApplication& a) env::Console c; if (auto i=InstanceManager::singleton().currentInstance()) { - std::cout << i->name().toStdString() << "\n"; + std::cout << i->displayName().toStdString() << "\n"; } else { std::cout << "no instance configured\n"; } @@ -289,9 +289,8 @@ std::optional<int> CommandLine::runPostOrganizer(OrganizerCore& core) return 0; } - catch (const std::exception &e) { - reportError( - QObject::tr("failed to start shortcut: %1").arg(e.what())); + catch (std::exception&) { + // user was already warned return 1; } } @@ -451,7 +450,7 @@ std::optional<QString> CommandLine::instance() const // note that moshortcut:// overrides -i if (m_shortcut.isValid() && m_shortcut.hasInstance()) { - return m_shortcut.instance(); + return m_shortcut.instanceName(); } else if (m_vm.count("instance")) { return QString::fromStdString(m_vm["instance"].as<std::string>()); } @@ -817,7 +816,7 @@ std::optional<int> RunCommand::runPostOrganizer(OrganizerCore& core) reportError( QObject::tr("Executable '%1' not found in instance '%2'.") .arg(program) - .arg(InstanceManager::singleton().currentInstance()->name())); + .arg(InstanceManager::singleton().currentInstance()->displayName())); return 1; } |
