Crashfix for opening Deck editor (#5403)

* CardDatabase::getCards() no longer copies the whole database

---------

Co-authored-by: Jakub Mrowinski <ryder052@outlook.com>
This commit is contained in:
ryder052 2025-01-02 01:25:04 +01:00 committed by GitHub
parent 34df4cd060
commit 8c0093d453
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -59,8 +59,8 @@ DlgMoveTopCardsUntil::DlgMoveTopCardsUntil(QWidget *parent, QString _expr, uint
*/
static bool matchExistsInDb(const FilterString &filterString)
{
const auto cardDatabase = CardDatabaseManager::getInstance();
const auto allCards = cardDatabase->getCardList();
const auto *cardDatabase = CardDatabaseManager::getInstance();
const auto &allCards = cardDatabase->getCardList();
const auto it = std::find_if(allCards.begin(), allCards.end(),
[&filterString](const CardInfoPtr &card) { return filterString.check(card); });

View file

@ -477,9 +477,9 @@ public:
CardSetPtr getSet(const QString &setName);
bool isProviderIdForPreferredPrinting(const QString &cardName, const QString &providerId);
static CardInfoPerSet getSetInfoForCard(const CardInfoPtr &_card);
QList<CardInfoPtr> getCardList() const
const CardNameMap &getCardList() const
{
return cards.values();
return cards;
}
SetList getSetList() const;
LoadStatus loadFromFile(const QString &fileName);