[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

@ -34,7 +34,6 @@ class CardItem : public AbstractCardItem
Q_OBJECT
private:
CardDragItem *dragItem;
QList<CardItem *> attachedCards;
void prepareDelete();
void handleClickedToPlay(bool shiftHeld);
@ -116,22 +115,22 @@ public:
{
state->setDestroyOnZoneChange(_destroy);
}
[[nodiscard]] CardItem *getAttachedTo() const
[[nodiscard]] CardState *getAttachedTo() const
{
return state->getAttachedTo();
}
void setAttachedTo(CardItem *_attachedTo);
void addAttachedCard(CardItem *card)
{
attachedCards.append(card);
state->addAttachedCard(card);
}
void removeAttachedCard(CardItem *card)
{
attachedCards.removeOne(card);
state->removeAttachedCard(card);
}
[[nodiscard]] const QList<CardItem *> &getAttachedCards() const
{
return attachedCards;
return state->getAttachedCards();
}
void resetState(bool keepAnnotations = false);
void processCardInfo(const ServerInfo_Card &_info);