summaryrefslogtreecommitdiff
path: root/src/executableslist.h
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2015-08-02 20:09:56 +0200
committerTannin <devnull@localhost>2015-08-02 20:09:56 +0200
commit643a50ad5a6f6851db63ece41a399d9783dc5acd (patch)
tree3de48db745f117f45aa7f206b09df4aa956f32de /src/executableslist.h
parent9c17ecc87ee6e1af87b6ee7e1b970d15dd19fbe3 (diff)
- changed the way flags on executables are stored in memory
- some coding style fixes
Diffstat (limited to 'src/executableslist.h')
-rw-r--r--src/executableslist.h35
1 files changed, 13 insertions, 22 deletions
diff --git a/src/executableslist.h b/src/executableslist.h
index 4e1ad644..907b37aa 100644
--- a/src/executableslist.h
+++ b/src/executableslist.h
@@ -39,32 +39,23 @@ struct Executable {
QString m_SteamAppID;
QString m_WorkingDirectory;
- enum class Type {
- Game,
- Custom
+ enum Flag {
+ CustomExecutable = 0x01,
+ ShowInToolbar = 0x02,
+ UseApplicationIcon = 0x04
};
- enum class Toolbar {
- Disabled,
- Enabled
- };
-
- enum class Icon {
- MO,
- Application
- };
+ Q_DECLARE_FLAGS(Flags, Flag)
- Type m_Type;
- Toolbar m_Toolbar;
- Icon m_Icon;
+ Flags m_Flags;
- bool isCustom() const { return m_Type == Type::Custom; }
+ bool isCustom() const { return m_Flags.testFlag(CustomExecutable); }
- bool shownOnToolbar() const { return m_Toolbar == Toolbar::Enabled; }
+ bool shownOnToolbar() const { return m_Flags.testFlag(ShowInToolbar); }
- void showOnToolbar(bool state) { m_Toolbar = state ? Toolbar::Enabled : Toolbar::Disabled; }
+ void showOnToolbar(bool state);
- bool usesOwnIcon() const { return m_Icon == Icon::Application; }
+ bool usesOwnIcon() const { return m_Flags.testFlag(UseApplicationIcon); }
};
@@ -149,9 +140,7 @@ public:
const QString &workingDirectory,
MOBase::ExecutableInfo::CloseMOStyle closeMO,
const QString &steamAppID,
- Executable::Type custom,
- Executable::Toolbar toolbar,
- Executable::Icon ownicon);
+ Executable::Flags flags);
/**
* @brief remove the executable with the specified file name. This needs to be an absolute file path
@@ -198,4 +187,6 @@ private:
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(Executable::Flags)
+
#endif // EXECUTABLESLIST_H