[CardDatabase] Pass CardInfoPtr by const ref (#6998)
Some checks are pending
Build Desktop / Configure (push) Waiting to run
Build Desktop / Debian 13 (push) Blocked by required conditions
Build Desktop / Debian 12 (push) Blocked by required conditions
Build Desktop / Fedora 44 (push) Blocked by required conditions
Build Desktop / Fedora 43 (push) Blocked by required conditions
Build Desktop / Servatrice_Debian 12 (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 (push) Blocked by required conditions
Build Desktop / Ubuntu 24.04 (push) Blocked by required conditions
Build Desktop / Arch (push) Blocked by required conditions
Build Desktop / macOS 14 (push) Blocked by required conditions
Build Desktop / macOS 15 (push) Blocked by required conditions
Build Desktop / macOS 13 Intel (push) Blocked by required conditions
Build Desktop / macOS 15 Debug (push) Blocked by required conditions
Build Desktop / Windows 10 (push) Blocked by required conditions
Build Docker Image / amd64 & arm64 (push) Waiting to run

* [CardDatabase] Pass CardInfoPtr by const ref

* trailing newline
This commit is contained in:
RickyRister 2026-06-14 04:46:18 -07:00 committed by GitHub
parent 5ffe344779
commit 0f3e6fbe26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 9 deletions

View file

@ -92,7 +92,7 @@ void CardDatabase::refreshCachedReverseRelatedCards()
}
}
void CardDatabase::addCard(CardInfoPtr card)
void CardDatabase::addCard(const CardInfoPtr &card)
{
if (card == nullptr) {
qCWarning(CardDatabaseLog) << "CardDatabase::addCard(nullptr)";
@ -118,7 +118,7 @@ void CardDatabase::addCard(CardInfoPtr card)
emit cardAdded(card);
}
void CardDatabase::removeCard(CardInfoPtr card)
void CardDatabase::removeCard(const CardInfoPtr &card)
{
if (card.isNull()) {
qCWarning(CardDatabaseLog) << "CardDatabase::removeCard(nullptr)";
@ -143,7 +143,7 @@ void CardDatabase::removeCard(CardInfoPtr card)
emit cardRemoved(card);
}
void CardDatabase::addSet(CardSetPtr set)
void CardDatabase::addSet(const CardSetPtr &set)
{
sets.insert(set->getShortName(), set);
}
@ -215,7 +215,7 @@ void CardDatabase::notifyEnabledSetsChanged()
emit cardDatabaseEnabledSetsChanged();
}
void CardDatabase::addFormat(FormatRulesPtr format)
void CardDatabase::addFormat(const FormatRulesPtr &format)
{
formats.insert(format->formatName.toLower(), format);
}
}

View file

@ -88,7 +88,7 @@ public:
* @brief Removes a card from the database.
* @param card Pointer to the card to remove.
*/
void removeCard(CardInfoPtr card);
void removeCard(const CardInfoPtr &card);
/** @brief Clears all cards, sets, and internal state. */
void clear();
@ -140,15 +140,15 @@ public slots:
* @brief Adds a card to the database.
* @param card CardInfoPtr to add.
*/
void addCard(CardInfoPtr card);
void addCard(const CardInfoPtr &card);
/**
* @brief Adds a set to the database.
* @param set Pointer to CardSet to add.
*/
void addSet(CardSetPtr set);
void addSet(const CardSetPtr &set);
void addFormat(FormatRulesPtr format);
void addFormat(const FormatRulesPtr &format);
/** @brief Loads card databases from configured paths. */
void loadCardDatabases();