diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-10-10 06:12:07 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-10 06:12:07 -0400 |
| commit | 168fc950f9b15ce89084316d96a1f613a12e3013 (patch) | |
| tree | 73b1eb1afd04830e65c25060f1ce4763db98b642 /src/executableslist.cpp | |
| parent | 0f5ecb8b78b86f309be3ef1902dbf4ee51738fc4 (diff) | |
| parent | 4d3495b3fb00b644c57e773bbcdbfb2eee7c0ea6 (diff) | |
Merge pull request #863 from isanae/executables-fixes
Executables fixes
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
|
