diff --git a/kdevplatform/shell/projectcontroller.cpp b/kdevplatform/shell/projectcontroller.cpp --- a/kdevplatform/shell/projectcontroller.cpp +++ b/kdevplatform/shell/projectcontroller.cpp @@ -206,12 +206,13 @@ QVector findPluginsForProject( IProject* project ) const { const QList plugins = m_core->pluginController()->loadedPlugins(); + const IBuildSystemManager* const buildSystemManager = project->buildSystemManager(); QVector projectPlugins; QList buildersForKcm; // Important to also include the "top" builder for the project, so // projects with only one such builder are kept working. Otherwise the project config // dialog is empty for such cases. - if( IBuildSystemManager* buildSystemManager = project->buildSystemManager() ) { + if (buildSystemManager) { buildersForKcm << buildSystemManager->builder(); collectBuilders( buildersForKcm, buildSystemManager->builder(), project ); } @@ -229,6 +230,15 @@ { continue; } + // Do not show config pages for analyzer tools which need a buildSystemManager + // TODO: turn into generic feature to disable plugin config pages which do not apply for a project + if (!buildSystemManager) { + const auto required = KPluginMetaData::readStringList(info.rawData(), QStringLiteral("X-KDevelop-IRequired")); + if (required.contains(QLatin1String("org.kdevelop.IBuildSystemManager"))) { + continue; + } + } + qCDebug(SHELL) << "Using plugin" << info.pluginId() << "for project" << project->name(); projectPlugins << plugin; } diff --git a/plugins/clazy/kdevclazy.json b/plugins/clazy/kdevclazy.json --- a/plugins/clazy/kdevclazy.json +++ b/plugins/clazy/kdevclazy.json @@ -73,5 +73,8 @@ ] }, "X-KDevelop-Category": "Global", + "X-KDevelop-IRequired": [ + "org.kdevelop.IBuildSystemManager" + ], "X-KDevelop-Mode": "GUI" }