From 667ef70cc89e52b6f5ae5897d79cefdda3cc0e16 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Sun, 24 Feb 2019 21:18:52 -0600 Subject: Do not add inactive tool plugins to the tools menu --- src/mainwindow.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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 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>> submenuMap; for (auto toolPlugin : toolPlugins) { -- cgit v1.3.1