summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2020-11-10 21:38:58 +0100
committerMikaël Capelle <capelle.mikael@gmail.com>2020-11-11 20:29:58 +0100
commit74ec078976fbd64433142e6974f30cc113047c00 (patch)
treec39b521f516629f93c7291c36d98a86062ba6f33 /src/mainwindow.cpp
parente1dceec67a53f5332b2f92ac2901309f0c0ed882 (diff)
Replace usage of IPlugin::isActive().
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp8
1 files changed, 5 insertions, 3 deletions
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<QObject>()) {
IPlugin *plugin = qobject_cast<IPlugin*>(pluginObj);
- if (plugin == nullptr || plugin->isActive()) {
+ if (plugin == nullptr || m_PluginContainer.isEnabled(plugin)) {
IPluginDiagnose *diagnose = qobject_cast<IPluginDiagnose*>(pluginObj);
if (diagnose != nullptr)
numProblems += diagnose->activeProblems().size();
@@ -1663,9 +1663,11 @@ void MainWindow::registerPluginTools(std::vector<IPluginTool *> 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<QObject>(), this);
+ ProblemsDialog problems(m_PluginContainer, this);
problems.exec();
scheduleCheckForProblems();