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/moshortcut.h | |
| 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/moshortcut.h')
| -rw-r--r-- | src/moshortcut.h | 33 |
1 files changed, 27 insertions, 6 deletions
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 <QString> +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; |
