| 472 | } |
| 473 | |
| 474 | void TopDUContextLocalPrivate::rebuildStructure(const TopDUContext* imported) |
| 475 | { |
| 476 | if (m_ctxt == imported) |
| 477 | return; |
| 478 | |
| 479 | for (auto& importedContext : std::as_const(m_importedContexts)) { |
| 480 | auto* top = dynamic_cast<TopDUContext*>(importedContext.context(nullptr)); |
| 481 | if (top) { |
| 482 | // top->m_local->needImportStructure(); |
| 483 | if (top == imported) { |
| 484 | addImportedContextRecursion(top, imported, 1); |
| 485 | } else { |
| 486 | RecursiveImports::const_iterator it2 = top->m_local->m_recursiveImports.constFind(imported); |
| 487 | if (it2 != top->m_local->m_recursiveImports.constEnd()) { |
| 488 | addImportedContextRecursion(top, imported, (*it2).first + 1); |
| 489 | } |
| 490 | } |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | for (unsigned int a = 0; a < m_ctxt->d_func()->m_importedContextsSize(); ++a) { |
| 495 | auto* top = |
| 496 | dynamic_cast<TopDUContext*>(const_cast<DUContext*>(m_ctxt->d_func()->m_importedContexts()[a].context(nullptr))); //To avoid detaching, use const iterator |
| 497 | if (top) { |
| 498 | // top->m_local->needImportStructure(); |
| 499 | if (top == imported) { |
| 500 | addImportedContextRecursion(top, imported, 1); |
| 501 | } else { |
| 502 | RecursiveImports::const_iterator it2 = top->m_local->m_recursiveImports.constFind(imported); |
| 503 | if (it2 != top->m_local->m_recursiveImports.constEnd()) { |
| 504 | addImportedContextRecursion(top, imported, (*it2).first + 1); |
| 505 | } |
| 506 | } |
| 507 | } |
| 508 | } |
| 509 | } |
| 510 | |
| 511 | void TopDUContext::rebuildDynamicImportStructure() |
| 512 | { |
no test coverage detected