mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
[DeckListModel] Refactor: Don't access underlying decklist for iteration (#6427)
* [DeckListModel] Refactor: Don't access underlying decklist for iteration * add docs * extract method
This commit is contained in:
parent
715ee1d6fe
commit
367507e054
7 changed files with 73 additions and 100 deletions
|
|
@ -64,14 +64,10 @@ void VisualDatabaseDisplayNameFilterWidget::actLoadFromDeck()
|
|||
|
||||
if (!deckListModel)
|
||||
return;
|
||||
DeckList *decklist = deckListModel->getDeckList();
|
||||
if (!decklist)
|
||||
return;
|
||||
|
||||
QList<const DecklistCardNode *> cardsInDeck = decklist->getCardNodes();
|
||||
|
||||
for (auto currentCard : cardsInDeck) {
|
||||
createNameFilter(currentCard->getName());
|
||||
QList<QString> cardNames = deckListModel->getCardNames();
|
||||
for (auto cardName : cardNames) {
|
||||
createNameFilter(cardName);
|
||||
}
|
||||
|
||||
updateFilterModel();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue