mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
[DeckListModel] remove more access to underlying decklist for iteration (#6436)
* [DeckListModel] remove more access to underlying decklist for iteration * remove one last direct iteration of decklist
This commit is contained in:
parent
a0f977e80c
commit
c12f4e9d2a
5 changed files with 35 additions and 10 deletions
|
|
@ -386,15 +386,15 @@ void DeckEditorDeckDockWidget::updateBannerCardComboBox()
|
|||
|
||||
// Collect unique (name, providerId) pairs
|
||||
QSet<QPair<QString, QString>> bannerCardSet;
|
||||
QList<const DecklistCardNode *> cardsInDeck = deckModel->getDeckList()->getCardNodes();
|
||||
QList<CardRef> cardsInDeck = deckModel->getCardRefs();
|
||||
|
||||
for (auto currentCard : cardsInDeck) {
|
||||
if (!CardDatabaseManager::query()->getCard(currentCard->toCardRef())) {
|
||||
for (auto cardRef : cardsInDeck) {
|
||||
if (!CardDatabaseManager::query()->getCard(cardRef)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Insert one entry per distinct card, ignore copies
|
||||
bannerCardSet.insert({currentCard->getName(), currentCard->getCardProviderId()});
|
||||
bannerCardSet.insert({cardRef.name, cardRef.providerId});
|
||||
}
|
||||
|
||||
// Convert to sorted list
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue