| 725 | } |
| 726 | |
| 727 | void UsesWidget::UsesWidgetCollector::processUses(KDevelop::ReferencedTopDUContext topContext) |
| 728 | { |
| 729 | if (!m_widget) { |
| 730 | return; |
| 731 | } |
| 732 | |
| 733 | DUChainReadLocker lock; |
| 734 | |
| 735 | qCDebug(LANGUAGE) << "processing" << topContext->url().str(); |
| 736 | auto* widget = new TopContextUsesWidget(declaration(), declarations(), topContext.data()); |
| 737 | |
| 738 | // move to back if it's just the declaration/definition |
| 739 | bool toBack = widget->usesCount() == 0; |
| 740 | // move to front the item belonging to the current open document |
| 741 | IDocument* doc = ICore::self()->documentController()->activeDocument(); |
| 742 | bool toFront = doc && (doc->url() == topContext->url().toUrl()); |
| 743 | |
| 744 | widget->setExpanded(true); |
| 745 | |
| 746 | m_widget->addItem(widget, toFront ? ItemPriority::High : toBack ? ItemPriority::Low : ItemPriority::Medium); |
| 747 | m_widget->redrawHeaderLine(); |
| 748 | } |
| 749 | |
| 750 | QSize KDevelop::UsesWidget::sizeHint() const |
| 751 | { |
nothing calls this directly
no test coverage detected