| 716 | } |
| 717 | |
| 718 | void KDevelop::TextDocument::populateContextMenu( KTextEditor::View* v, QMenu* menu ) |
| 719 | { |
| 720 | Q_D(TextDocument); |
| 721 | |
| 722 | if (d->addedContextMenu) { |
| 723 | qCWarning(SHELL) << "populateContextMenu() called while we still handled another menu."; |
| 724 | d->cleanContextMenu(); |
| 725 | } |
| 726 | |
| 727 | d->currentContextMenu = menu; |
| 728 | connect(menu, &QMenu::aboutToHide, this, &TextDocument::unpopulateContextMenu); |
| 729 | |
| 730 | d->addedContextMenu = new QMenu(); |
| 731 | |
| 732 | EditorContext c(v, v->cursorPosition()); |
| 733 | auto extensions = Core::self()->pluginController()->queryPluginsForContextMenuExtensions(&c, d->addedContextMenu); |
| 734 | |
| 735 | ContextMenuExtension::populateMenu(d->addedContextMenu, extensions); |
| 736 | |
| 737 | const auto actions = d->addedContextMenu->actions(); |
| 738 | for (QAction* action : actions) { |
| 739 | menu->addAction(action); |
| 740 | } |
| 741 | } |
| 742 | |
| 743 | void KDevelop::TextDocument::repositoryCheckFinished(bool canRecreate) { |
| 744 | Q_D(TextDocument); |
nothing calls this directly
no test coverage detected