[Refactor] Move the attachment graph and card view teardown onto CardState (#7428)

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-10-31 18:44:13 +01:00 • committed by GitHub
parent 47c90cda10
commit 2335e064ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 54 additions and 19 deletions

View file

@ -14,11 +14,17 @@ void CardState::resetState(bool keepAnnotations)
annotation.clear();
}
attachedTo = nullptr;
attachedCards.clear();
setTapped(false, false);
setDoesntUntap(false);
emit stateReset();
}
void CardState::deleteView()
{
emit viewDeleteRequested();
}
void CardState::setCardRef(const CardRef &_cardRef)
{
if (cardRef == _cardRef) {
@ -189,7 +195,7 @@ void CardState::setDestroyOnZoneChange(bool _destroyOnZoneChange)
emit stateChanged();
}
void CardState::setAttachedTo(CardItem *_attachedTo)
void CardState::setAttachedTo(CardState *_attachedTo)
{
if (attachedTo == _attachedTo) {
return;