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

Method setOwner

kdevplatform/language/duchain/ducontext.cpp:485–503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

483}
484
485void DUContext::setOwner(Declaration* owner)
486{
487 ENSURE_CAN_WRITE
488 DUCHAIN_D_DYNAMIC(DUContext);
489 if (owner == d->m_owner.declaration())
490 return;
491
492 Declaration* oldOwner = d->m_owner.declaration();
493
494 d->m_owner = owner;
495
496 //Q_ASSERT(!oldOwner || oldOwner->internalContext() == this);
497 if (oldOwner && oldOwner->internalContext() == this)
498 oldOwner->setInternalContext(nullptr);
499
500 //The context set as internal context should always be the last opened context
501 if (owner)
502 owner->setInternalContext(this);
503}
504
505DUContext* DUContext::parentContext() const
506{

Callers 2

~DeclarationMethod · 0.80
setInternalContextMethod · 0.80

Calls 3

setInternalContextMethod · 0.80
declarationMethod · 0.45
internalContextMethod · 0.45

Tested by

no test coverage detected