Return cardlists directly.

This commit is contained in:
Lukas Brübach 2025-03-02 09:54:51 +01:00
parent 66065045f0
commit 8af56f5c3d
5 changed files with 17 additions and 17 deletions

View file

@ -484,9 +484,9 @@ void DeckListModel::setDeckList(DeckLoader *_deck)
rebuildTree();
}
QList<CardInfoPtr> *DeckListModel::getCardsAsCardInfoPtrs() const
QList<CardInfoPtr> DeckListModel::getCardsAsCardInfoPtrs() const
{
QList<CardInfoPtr> *cards = new QList<CardInfoPtr>();
QList<CardInfoPtr> cards;
DeckList *decklist = getDeckList();
if (!decklist) {
return cards;
@ -507,7 +507,7 @@ QList<CardInfoPtr> *DeckListModel::getCardsAsCardInfoPtrs() const
CardInfoPtr info = CardDatabaseManager::getInstance()->getCardByNameAndProviderId(
currentCard->getName(), currentCard->getCardProviderId());
if (info) {
cards->append(info);
cards.append(info);
} else {
qDebug() << "Card not found in database!";
}
@ -517,9 +517,9 @@ QList<CardInfoPtr> *DeckListModel::getCardsAsCardInfoPtrs() const
return cards;
}
QList<CardInfoPtr> *DeckListModel::getCardsAsCardInfoPtrsForZone(QString zoneName) const
QList<CardInfoPtr> DeckListModel::getCardsAsCardInfoPtrsForZone(QString zoneName) const
{
QList<CardInfoPtr> *cards = new QList<CardInfoPtr>();
QList<CardInfoPtr> cards;
DeckList *decklist = getDeckList();
if (!decklist) {
return cards;
@ -541,7 +541,7 @@ QList<CardInfoPtr> *DeckListModel::getCardsAsCardInfoPtrsForZone(QString zoneNam
CardInfoPtr info = CardDatabaseManager::getInstance()->getCardByNameAndProviderId(
currentCard->getName(), currentCard->getCardProviderId());
if (info) {
cards->append(info);
cards.append(info);
} else {
qDebug() << "Card not found in database!";
}