Refactor: remove second param from CardZone::getCard (#6041)

This commit is contained in:
RickyRister 2025-07-16 02:54:31 -07:00 committed by GitHub
parent a9b3be33e0
commit 95190c321c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 17 deletions

View file

@ -154,7 +154,7 @@ void CardZone::addCard(CardItem *card, const bool reorganize, const int x, const
emit cardCountChanged();
}
CardItem *CardZone::getCard(int cardId, const QString &cardName)
CardItem *CardZone::getCard(int cardId)
{
CardItem *c = cards.findCard(cardId);
if (!c) {
@ -162,12 +162,10 @@ CardItem *CardZone::getCard(int cardId, const QString &cardName)
return nullptr;
}
// If the card's id is -1, this zone is invisible,
// so we need to give the card an id and a name as it comes out.
// so we need to give the card an id as it comes out.
// It can be assumed that in an invisible zone, all cards are equal.
if ((c->getId() == -1) || (c->getName().isEmpty())) {
if (c->getId() == -1) {
c->setId(cardId);
// TODO: also set providerId
c->setCardRef({cardName});
}
return c;
}