| 384 | } |
| 385 | |
| 386 | QList<OneUseWidget*> createUseWidgets(const CodeRepresentation& code, int usedDeclarationIndex, IndexedDeclaration decl, |
| 387 | DUContext* context) |
| 388 | { |
| 389 | QList<OneUseWidget*> ret; |
| 390 | VERIFY_FOREGROUND_LOCKED |
| 391 | |
| 392 | for (int useIndex = 0; useIndex < context->usesCount(); ++useIndex) |
| 393 | if (context->uses()[useIndex].m_declarationIndex == usedDeclarationIndex) |
| 394 | ret << |
| 395 | new OneUseWidget(decl, context->url(), context->transformFromLocalRevision( |
| 396 | context->uses()[useIndex].m_range), code); |
| 397 | |
| 398 | const auto childContexts = context->childContexts(); |
| 399 | for (DUContext* child : childContexts) { |
| 400 | if (!isNewGroup(context, child)) |
| 401 | ret += createUseWidgets(code, usedDeclarationIndex, decl, child); |
| 402 | } |
| 403 | |
| 404 | return ret; |
| 405 | } |
| 406 | |
| 407 | ContextUsesWidget::ContextUsesWidget(const CodeRepresentation& code, const QList<IndexedDeclaration>& usedDeclarations, |
| 408 | IndexedDUContext context) : m_context(context) |
no test coverage detected