diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-10-08 23:03:45 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-10-08 23:03:45 -0400 |
| commit | 21f55da7d3688eafc9e2dbae4535cf0c554be121 (patch) | |
| tree | 5c2fe0e164d957d190fa2fb294d9d5557aff3442 /src/executableslist.cpp | |
| parent | de48d430eca4042f48be461fe5dc70d7e75d5596 (diff) | |
added hide flag to executables
Diffstat (limited to 'src/executableslist.cpp')
| -rw-r--r-- | src/executableslist.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/executableslist.cpp b/src/executableslist.cpp index dce9181b..1be34b53 100644 --- a/src/executableslist.cpp +++ b/src/executableslist.cpp @@ -84,6 +84,9 @@ void ExecutablesList::load(const MOBase::IPluginGame* game, const Settings& s) if (map["ownicon"].toBool())
flags |= Executable::UseApplicationIcon;
+ if (map["hide"].toBool())
+ flags |= Executable::Hide;
+
if (map.contains("custom")) {
// the "custom" setting only exists in older versions
needsUpgrade = true;
@@ -116,6 +119,7 @@ void ExecutablesList::store(Settings& s) map["title"] = item.title();
map["toolbar"] = item.isShownOnToolbar();
map["ownicon"] = item.usesOwnIcon();
+ map["hide"] = item.hide();
map["binary"] = item.binaryInfo().absoluteFilePath();
map["arguments"] = item.arguments();
map["workingDirectory"] = item.workingDirectory();
@@ -343,6 +347,10 @@ void ExecutablesList::dump() const flags.push_back("icon");
}
+ if (e.flags() & Executable::Hide) {
+ flags.push_back("hide");
+ }
+
log::debug(
" . executable '{}'\n"
" binary: {}\n"
@@ -456,11 +464,13 @@ bool Executable::usesOwnIcon() const return m_flags.testFlag(UseApplicationIcon);
}
-void Executable::mergeFrom(const Executable& other)
+bool Executable::hide() const
{
- // flags on plugin executables that the user is allowed to change
- const auto allow = ShowInToolbar;
+ return m_flags.testFlag(Hide);
+}
+void Executable::mergeFrom(const Executable& other)
+{
// this happens after executables are loaded from settings and plugin
// executables are being added, or when users are modifying executables
|
