From 74ec078976fbd64433142e6974f30cc113047c00 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Tue, 10 Nov 2020 21:38:58 +0100 Subject: Replace usage of IPlugin::isActive(). --- src/mainwindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 94bc5800..93ca415d 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1132,7 +1132,7 @@ void MainWindow::checkForProblemsImpl() size_t numProblems = 0; for (QObject *pluginObj : m_PluginContainer.plugins()) { IPlugin *plugin = qobject_cast(pluginObj); - if (plugin == nullptr || plugin->isActive()) { + if (plugin == nullptr || m_PluginContainer.isEnabled(plugin)) { IPluginDiagnose *diagnose = qobject_cast(pluginObj); if (diagnose != nullptr) numProblems += diagnose->activeProblems().size(); @@ -1663,9 +1663,11 @@ void MainWindow::registerPluginTools(std::vector toolPlugins) } ); + // TODO: I don't know when this method is called? Maybe the check should be perform when + // the context menu is opened? // Remove inactive plugins toolPlugins.erase( - std::remove_if(toolPlugins.begin(), toolPlugins.end(), [](IPluginTool *plugin) -> bool { return !plugin->isActive(); }), + std::remove_if(toolPlugins.begin(), toolPlugins.end(), [this](IPluginTool *plugin) { return !m_PluginContainer.isEnabled(plugin); }), toolPlugins.end() ); @@ -5972,7 +5974,7 @@ void MainWindow::on_actionNotifications_triggered() future.waitForFinished(); - ProblemsDialog problems(m_PluginContainer.plugins(), this); + ProblemsDialog problems(m_PluginContainer, this); problems.exec(); scheduleCheckForProblems(); -- cgit v1.3.1