| 248 | } |
| 249 | |
| 250 | KDevelop::ContextMenuExtension Plugin::contextMenuExtension(KDevelop::Context* context) |
| 251 | { |
| 252 | KDevelop::IDocument* doc = core()->documentController()->activeDocument(); |
| 253 | KDevelop::ContextMenuExtension extension = KDevelop::IPlugin::contextMenuExtension(context); |
| 254 | |
| 255 | if (context->type() == KDevelop::Context::EditorContext) { |
| 256 | |
| 257 | auto mime = doc->mimeType().name(); |
| 258 | if (mime == QLatin1String("text/x-c++src") || mime == QLatin1String("text/x-csrc")) { |
| 259 | QAction* action |
| 260 | = new QAction(QIcon::fromTheme("document-new"), i18n("Check current unit with clang-tidy"), this); |
| 261 | connect(action, SIGNAL(triggered(bool)), this, SLOT(runClangTidyFile())); |
| 262 | extension.addAction(KDevelop::ContextMenuExtension::AnalyzeGroup, action); |
| 263 | } |
| 264 | } |
| 265 | return extension; |
| 266 | } |
| 267 | |
| 268 | KDevelop::ConfigPage* Plugin::perProjectConfigPage(int number, const ProjectConfigOptions& options, QWidget* parent) |
| 269 | { |
nothing calls this directly
no test coverage detected