diff options
| author | Chris Bessent <lost.dragonist@gmail.com> | 2021-03-02 02:41:16 -0700 |
|---|---|---|
| committer | Chris Bessent <lost.dragonist@gmail.com> | 2021-03-02 02:41:16 -0700 |
| commit | 071550f7fb269f8ff6f539a1254b21d5f71059d0 (patch) | |
| tree | b9556c0f5edfc0b8c760d26a766553731998cb92 /src | |
| parent | f8a50edd0fa010a32057158c9033130d92267fd8 (diff) | |
Allow plugins to disable themselves by default
Diffstat (limited to 'src')
| -rw-r--r-- | src/plugincontainer.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugincontainer.cpp b/src/plugincontainer.cpp index 93a66ece..c5896d2e 100644 --- a/src/plugincontainer.cpp +++ b/src/plugincontainer.cpp @@ -42,9 +42,10 @@ namespace bf = boost::fusion; // the one corresponding to the currently managed games.
// - If a plugin has a master plugin (IPlugin::master()), it cannot be enabled/disabled by users,
// and will follow the enabled/disabled state of its parent.
-// - Each plugin has an "enabled" setting stored in persistence. A plugin is considered disabled
-// if the setting is false.
-// - If the setting is true or does not exist, a plugin is considered disabled if one of its
+// - Each plugin has an "enabled" setting stored in persistence. If the setting does not exist,
+// the plugin's enabledByDefault is used instead.
+// - A plugin is considered disabled if the setting is false.
+// - If the setting is true, a plugin is considered disabled if one of its
// requirements is not met.
// - Users cannot enable a plugin if one of its requirements is not met.
//
@@ -599,7 +600,7 @@ bool PluginContainer::isEnabled(IPlugin* plugin) const }
// Check if the plugin is enabled:
- if (!m_Organizer->persistent(plugin->name(), "enabled", true).toBool()) {
+ if (!m_Organizer->persistent(plugin->name(), "enabled", plugin->enabledByDefault()).toBool()) {
return false;
}
|
