From 071550f7fb269f8ff6f539a1254b21d5f71059d0 Mon Sep 17 00:00:00 2001 From: Chris Bessent Date: Tue, 2 Mar 2021 02:41:16 -0700 Subject: Allow plugins to disable themselves by default --- src/plugincontainer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/plugincontainer.cpp') 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; } -- cgit v1.3.1