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/moshortcut.h | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'src/moshortcut.h') diff --git a/src/moshortcut.h b/src/moshortcut.h index 33346bb9..a693b6df 100644 --- a/src/moshortcut.h +++ b/src/moshortcut.h @@ -3,21 +3,42 @@ #include +class Instance; + class MOShortcut { public: MOShortcut(const QString& link={}); - /// true iff intialized using a valid moshortcut link - bool isValid() const { return m_valid; } + // true if initialized using a valid moshortcut link + // + bool isValid() const; + + // whether an instance name was given + // + bool hasInstance() const; + + // whether an executable name was given + // + bool hasExecutable() const; - bool hasInstance() const { return m_hasInstance; } + // name of the instance given, "Portable" for portable; undefined if + // hasInstance() returns false + // + QString instanceDisplayName() const; - bool hasExecutable() const { return m_hasExecutable; } + // name of the instance given, empty for portable; undefined if hasInstance() + // returns false + // + const QString& instanceName() const; - const QString& instance() const { return m_instance; } + // name of the executable given + // + const QString& executableName() const; - const QString& executable() const { return m_executable; } + // whether this shortcut is for the given instance + // + bool isForInstance(const Instance& i) const; QString toString() const; -- cgit v1.3.1