mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 00:54:53 -07:00
Have CardDatabase::getPreferredPrintingInfo respect card provider ID overrides (pinned printings)
Took 13 minutes Took 37 seconds Took 10 seconds Took 10 seconds # Commit time for manual adjustment: # Took 30 seconds Took 15 seconds Took 8 minutes Took 21 seconds
This commit is contained in:
parent
dbd1d30ca8
commit
3ccb0cbb23
13 changed files with 97 additions and 38 deletions
|
|
@ -143,7 +143,7 @@ void DeckEditorDatabaseDisplayWidget::updateCard(const QModelIndex ¤t, con
|
|||
}
|
||||
|
||||
if (!current.model()->hasChildren(current.sibling(current.row(), 0))) {
|
||||
emit cardChanged(getCardOrPinnedPrinting(cardName));
|
||||
emit cardChanged(CardDatabaseManager::query()->getPreferredCard(cardName));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -176,21 +176,7 @@ ExactCard DeckEditorDatabaseDisplayWidget::currentCard() const
|
|||
|
||||
const QString cardName = currentIndex.sibling(currentIndex.row(), 0).data().toString();
|
||||
|
||||
return getCardOrPinnedPrinting(cardName);
|
||||
}
|
||||
|
||||
ExactCard DeckEditorDatabaseDisplayWidget::getCardOrPinnedPrinting(QString cardName) const
|
||||
{
|
||||
const auto &cardProviderId = SettingsCache::instance().cardOverrides().getCardPreferenceOverride(cardName);
|
||||
|
||||
ExactCard card = CardDatabaseManager::query()->getCard({cardName});
|
||||
|
||||
if (cardProviderId != "") {
|
||||
return ExactCard(card.getCardPtr(),
|
||||
CardDatabaseManager::query()->getSpecificPrinting({cardName, cardProviderId}));
|
||||
}
|
||||
|
||||
return card;
|
||||
return CardDatabaseManager::query()->getPreferredCard(cardName);
|
||||
}
|
||||
|
||||
void DeckEditorDatabaseDisplayWidget::databaseCustomMenu(QPoint point)
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ public:
|
|||
|
||||
public slots:
|
||||
ExactCard currentCard() const;
|
||||
ExactCard getCardOrPinnedPrinting(QString cardName) const;
|
||||
void setFilterTree(FilterTree *filterTree);
|
||||
void clearAllDatabaseFilters();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue