| 660 | } |
| 661 | |
| 662 | void PluginContainer::setEnabled(MOBase::IPlugin* plugin, bool enable, |
| 663 | bool dependencies) |
| 664 | { |
| 665 | // If required, disable dependencies: |
| 666 | if (!enable && dependencies) { |
| 667 | for (auto* p : requirements(plugin).requiredFor()) { |
| 668 | // No need to "recurse" here since requiredFor already does it. |
| 669 | setEnabled(p, false, false); |
| 670 | } |
| 671 | } |
| 672 | |
| 673 | // Always disable/enable child plugins: |
| 674 | for (auto* p : requirements(plugin).children()) { |
| 675 | // "Child" plugin should have no dependencies. |
| 676 | setEnabled(p, enable, false); |
| 677 | } |
| 678 | |
| 679 | m_Organizer->setPersistent(plugin->name(), "enabled", enable, true); |
| 680 | |
| 681 | if (enable) { |
| 682 | emit pluginEnabled(plugin); |
| 683 | } else { |
| 684 | emit pluginDisabled(plugin); |
| 685 | } |
| 686 | } |
| 687 | |
| 688 | MOBase::IPlugin* PluginContainer::plugin(QString const& pluginName) const |
| 689 | { |
nothing calls this directly
no test coverage detected