diff options
| author | LostDragonist <lost.dragonist@gmail.com> | 2019-02-24 21:18:52 -0600 |
|---|---|---|
| committer | LostDragonist <lost.dragonist@gmail.com> | 2019-02-24 21:18:52 -0600 |
| commit | 667ef70cc89e52b6f5ae5897d79cefdda3cc0e16 (patch) | |
| tree | ba7378b98c8f25e8b6a8b83b40c1307b3918f6bc | |
| parent | 899fa6e78db69ca425912da7a08f2c74ceb75f0a (diff) | |
Do not add inactive tool plugins to the tools menu
| -rw-r--r-- | src/mainwindow.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index efd5726e..bb1a9ec5 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1139,6 +1139,12 @@ void MainWindow::registerPluginTools(std::vector<IPluginTool *> toolPlugins) } ); + // Remove inactive plugins + toolPlugins.erase( + std::remove_if(toolPlugins.begin(), toolPlugins.end(), [](IPluginTool *plugin) -> bool { return !plugin->isActive(); }), + toolPlugins.end() + ); + // Group the plugins into submenus QMap<QString, QList<QPair<QString, IPluginTool *>>> submenuMap; for (auto toolPlugin : toolPlugins) { |
