From 48274f33579076711c0475e84c7adf68c52df733 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Fri, 12 Feb 2021 03:22:52 -0500 Subject: - 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 --- src/commandline.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/commandline.cpp') 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 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 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 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()); } @@ -817,7 +816,7 @@ std::optional 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; } -- cgit v1.3.1