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

Method showUsesDelayed

plugins/contextbrowser/contextbrowser.cpp:364–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362}
363
364void ContextBrowserPlugin::showUsesDelayed(const DeclarationPointer& declaration)
365{
366 DUChainReadLocker lock;
367
368 Declaration* decl = declaration.data();
369 if (!decl) {
370 return;
371 }
372 QWidget* toolView = ICore::self()->uiController()->findToolView(i18nc("@title:window", "Code Browser"), m_viewFactory,
373 KDevelop::IUiController::CreateAndRaise);
374 if (!toolView) {
375 return;
376 }
377 auto* view = qobject_cast<ContextBrowserView*>(toolView);
378 Q_ASSERT(view);
379 view->allowLockedUpdate();
380 view->setDeclaration(decl, decl->topContext(), true);
381 //We may get deleted while the call to acceptLink, so make sure we don't crash in that case
382 QPointer<AbstractNavigationWidget> widget = qobject_cast<AbstractNavigationWidget*>(view->navigationWidget());
383 if (widget && widget->context()) {
384 auto nextContext = widget->context()->execute(
385 NavigationAction(declaration, KDevelop::NavigationAction::ShowUses));
386
387 if (widget) {
388 widget->setContext(nextContext);
389 }
390 }
391}
392
393void ContextBrowserPlugin::findUses()
394{

Callers

nothing calls this directly

Calls 11

NavigationActionClass · 0.85
findToolViewMethod · 0.80
uiControllerMethod · 0.80
allowLockedUpdateMethod · 0.80
navigationWidgetMethod · 0.80
dataMethod · 0.45
setDeclarationMethod · 0.45
topContextMethod · 0.45
contextMethod · 0.45
executeMethod · 0.45
setContextMethod · 0.45

Tested by

no test coverage detected