MCPcopy Create free account
hub / github.com/KDE/kdevelop / doNavigate

Method doNavigate

plugins/contextbrowser/contextbrowser.cpp:1472–1512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1470}
1471
1472void ContextBrowserPlugin::doNavigate(NavigationActionType action)
1473{
1474 auto* view = qobject_cast<KTextEditor::View*>(sender());
1475 if (!view) {
1476 qCWarning(PLUGIN_CONTEXTBROWSER) << "sender is not a view";
1477 return;
1478 }
1479 if (view->isCompletionActive())
1480 return; // If code completion is active, the actions should be handled by the completion widget
1481
1482 QWidget* widget = m_currentNavigationWidget.data();
1483
1484 if (!widget || !widget->isVisible()) {
1485 ContextBrowserView* contextView = browserViewForWidget(view);
1486 if (contextView)
1487 widget = contextView->navigationWidget();
1488 }
1489
1490 if (auto* navWidget = dynamic_cast<QuickOpenEmbeddedWidgetInterface*>(widget)) {
1491 switch (action) {
1492 case Accept:
1493 navWidget->accept();
1494 break;
1495 case Back:
1496 navWidget->back();
1497 break;
1498 case Left:
1499 navWidget->previous();
1500 break;
1501 case Right:
1502 navWidget->next();
1503 break;
1504 case Up:
1505 navWidget->up();
1506 break;
1507 case Down:
1508 navWidget->down();
1509 break;
1510 }
1511 }
1512}
1513
1514void ContextBrowserPlugin::navigateAccept()
1515{

Callers

nothing calls this directly

Calls 8

navigationWidgetMethod · 0.80
dataMethod · 0.45
acceptMethod · 0.45
backMethod · 0.45
previousMethod · 0.45
nextMethod · 0.45
upMethod · 0.45
downMethod · 0.45

Tested by

no test coverage detected