summaryrefslogtreecommitdiff
path: root/src/moshortcut.h
blob: 2bfd1a4f6d4c679ebe8bd041fe60b222d9e98c9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef MODORGANIZER_MOSHORTCUT_INCLUDED
#define MODORGANIZER_MOSHORTCUT_INCLUDED

#include "instancemanager.h"
#include <QString>

class MOShortcut
{
public:
  MOShortcut(const QString& link = {});

  // 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;

  // name of the instance given, "Portable" for portable; undefined if
  // hasInstance() returns false
  //
  QString instanceDisplayName() const;

  // name of the instance given, empty for portable; undefined if hasInstance()
  // returns false
  //
  const QString& instanceName() const;

  // name of the executable given
  //
  const QString& executableName() const;

  // whether this shortcut is for the given instance
  //
  bool isForInstance(const Instance& i) const;

  QString toString() const;

private:
  QString m_instance;
  QString m_executable;
  bool m_valid;
  bool m_hasInstance;
  bool m_hasExecutable;
};

#endif  // MODORGANIZER_MOSHORTCUT_INCLUDED