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

Method setExpanded

kdevplatform/language/duchain/navigation/useswidget.cpp:551–584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

549}
550
551void TopContextUsesWidget::setExpanded(bool expanded)
552{
553 if (!expanded) {
554 m_toggleButton->setText(QLatin1String("&nbsp;&nbsp; <a href='toggleCollapsed'>[") +
555 i18nc("Refers to opening a UI element", "Expand") + QLatin1String("]</a>"));
556 deleteItems();
557 } else {
558 m_toggleButton->setText(QLatin1String("&nbsp;&nbsp; <a href='toggleCollapsed'>[") +
559 i18nc("Refers to closing a UI element", "Collapse") + QLatin1String("]</a>"));
560 if (hasItems())
561 return;
562 DUChainReadLocker lock(DUChain::lock());
563 TopDUContext* topContext = m_topContext.data();
564
565 if (topContext && m_declaration.data()) {
566 CodeRepresentation::Ptr code = createCodeRepresentation(topContext->url());
567 setUpdatesEnabled(false);
568
569 IndexedTopDUContext localTopContext(topContext);
570 for (const IndexedDeclaration& decl : std::as_const(m_allDeclarations)) {
571 if (decl.indexedTopContext() == localTopContext) {
572 addItem(new DeclarationWidget(*code, decl));
573 }
574 }
575
576 const auto contextUseWidgets = buildContextUses(*code, m_allDeclarations, topContext);
577 for (ContextUsesWidget* usesWidget : contextUseWidgets) {
578 addItem(usesWidget);
579 }
580
581 setUpdatesEnabled(true);
582 }
583 }
584}
585
586void TopContextUsesWidget::labelClicked()
587{

Callers 2

setAllExpandedMethod · 0.45
processUsesMethod · 0.45

Calls 6

createCodeRepresentationFunction · 0.85
buildContextUsesFunction · 0.85
setTextMethod · 0.45
dataMethod · 0.45
urlMethod · 0.45
indexedTopContextMethod · 0.45

Tested by

no test coverage detected