rename variables again

This commit is contained in:
RickyRister 2025-07-07 00:56:56 -07:00
parent 47434c64ee
commit 4f67e69390
7 changed files with 37 additions and 37 deletions

View file

@ -28,9 +28,9 @@ PictureToLoad::PictureToLoad(CardInfoPtr _card)
QList<CardSetPtr> PictureToLoad::extractSetsSorted(const CardInfoPtr &card) QList<CardSetPtr> PictureToLoad::extractSetsSorted(const CardInfoPtr &card)
{ {
QList<CardSetPtr> sortedSets; QList<CardSetPtr> sortedSets;
for (const auto &cardInfoPerSetList : card->getSets()) { for (const auto &printings : card->getSets()) {
for (const auto &set : cardInfoPerSetList) { for (const auto &printing : printings) {
sortedSets << set.getSet(); sortedSets << printing.getSet();
} }
} }
if (sortedSets.empty()) { if (sortedSets.empty()) {
@ -41,11 +41,11 @@ QList<CardSetPtr> PictureToLoad::extractSetsSorted(const CardInfoPtr &card)
// If the user hasn't disabled arts other than their personal preference... // If the user hasn't disabled arts other than their personal preference...
if (!SettingsCache::instance().getOverrideAllCardArtWithPersonalPreference()) { if (!SettingsCache::instance().getOverrideAllCardArtWithPersonalPreference()) {
// If the pixmapCacheKey corresponds to a specific set, we have to try to load it first. // If the pixmapCacheKey corresponds to a specific set, we have to try to load it first.
for (const auto &cardInfoPerSetList : card->getSets()) { for (const auto &printings : card->getSets()) {
for (const auto &set : cardInfoPerSetList) { for (const auto &printing : printings) {
if (QLatin1String("card_") + card->getName() + QString("_") + QString(set.getProperty("uuid")) == if (QLatin1String("card_") + card->getName() + QString("_") + QString(printing.getProperty("uuid")) ==
card->getPixmapCacheKey()) { card->getPixmapCacheKey()) {
long long setIndex = sortedSets.indexOf(set.getSet()); long long setIndex = sortedSets.indexOf(printing.getSet());
CardSetPtr setForCardProviderID = sortedSets.takeAt(setIndex); CardSetPtr setForCardProviderID = sortedSets.takeAt(setIndex);
sortedSets.prepend(setForCardProviderID); sortedSets.prepend(setForCardProviderID);
} }

View file

@ -99,13 +99,13 @@ QList<PrintingInfo> PrintingSelectorCardSortingWidget::sortSets(const SetToPrint
} }
QList<PrintingInfo> sortedPrintings; QList<PrintingInfo> sortedPrintings;
// Reconstruct sorted list of CardInfoPerSet // Reconstruct sorted list of PrintingInfo
for (const auto &set : sortedSets) { for (const auto &set : sortedSets) {
for (auto it = setMap.begin(); it != setMap.end(); ++it) { for (auto it = setMap.begin(); it != setMap.end(); ++it) {
for (const auto &cardInfoPerSet : it.value()) { for (const auto &printingInfo : it.value()) {
if (cardInfoPerSet.getSet() == set) { if (printingInfo.getSet() == set) {
if (!sortedPrintings.contains(cardInfoPerSet)) { if (!sortedPrintings.contains(printingInfo)) {
sortedPrintings << cardInfoPerSet; sortedPrintings << printingInfo;
} }
} }
} }

View file

@ -147,12 +147,12 @@ CardInfoPtr CardDatabase::getCardByNameAndProviderId(const QString &cardName, co
return info; return info;
} }
for (const auto &cardInfoPerSetList : info->getSets()) { for (const auto &printings : info->getSets()) {
for (const auto &set : cardInfoPerSetList) { for (const auto &printing : printings) {
if (set.getProperty("uuid") == providerId) { if (printing.getProperty("uuid") == providerId) {
CardInfoPtr cardFromSpecificSet = info->clone(); CardInfoPtr cardFromSpecificSet = info->clone();
cardFromSpecificSet->setPixmapCacheKey(QLatin1String("card_") + QString(info->getName()) + cardFromSpecificSet->setPixmapCacheKey(QLatin1String("card_") + QString(info->getName()) +
QString("_") + QString(set.getProperty("uuid"))); QString("_") + QString(printing.getProperty("uuid")));
return cardFromSpecificSet; return cardFromSpecificSet;
} }
} }
@ -354,8 +354,8 @@ PrintingInfo CardDatabase::getSpecificPrinting(const QString &cardName, const QS
return PrintingInfo(nullptr); return PrintingInfo(nullptr);
} }
for (const auto &cardInfoPerSetList : setMap) { for (const auto &printings : setMap) {
for (auto &cardInfoForSet : cardInfoPerSetList) { for (auto &cardInfoForSet : printings) {
if (cardInfoForSet.getProperty("uuid") == providerId) { if (cardInfoForSet.getProperty("uuid") == providerId) {
return cardInfoForSet; return cardInfoForSet;
} }
@ -383,8 +383,8 @@ PrintingInfo CardDatabase::getSpecificPrinting(const QString &cardName,
return PrintingInfo(nullptr); return PrintingInfo(nullptr);
} }
for (const auto &cardInfoPerSetList : setMap) { for (const auto &printings : setMap) {
for (auto &cardInfoForSet : cardInfoPerSetList) { for (auto &cardInfoForSet : printings) {
if (collectorNumber != nullptr) { if (collectorNumber != nullptr) {
if (cardInfoForSet.getSet()->getShortName() == setShortName && if (cardInfoForSet.getSet()->getShortName() == setShortName &&
cardInfoForSet.getProperty("num") == collectorNumber) { cardInfoForSet.getProperty("num") == collectorNumber) {
@ -431,8 +431,8 @@ PrintingInfo CardDatabase::getSetInfoForCard(const CardInfoPtr &_card)
return PrintingInfo(nullptr); return PrintingInfo(nullptr);
} }
for (const auto &cardInfoPerSetList : setMap) { for (const auto &printings : setMap) {
for (const auto &cardInfoForSet : cardInfoPerSetList) { for (const auto &cardInfoForSet : printings) {
if (QLatin1String("card_") + _card->getName() + QString("_") + cardInfoForSet.getProperty("uuid") == if (QLatin1String("card_") + _card->getName() + QString("_") + cardInfoForSet.getProperty("uuid") ==
_card->getPixmapCacheKey()) { _card->getPixmapCacheKey()) {
return cardInfoForSet; return cardInfoForSet;

View file

@ -98,9 +98,9 @@ bool CardDatabaseModel::checkCardHasAtLeastOneEnabledSet(CardInfoPtr card)
if (!showOnlyCardsFromEnabledSets) if (!showOnlyCardsFromEnabledSets)
return true; return true;
for (const auto &cardInfoPerSetList : card->getSets()) { for (const auto &printings : card->getSets()) {
for (const auto &set : cardInfoPerSetList) { for (const auto &printing : printings) {
if (set.getSet()->getEnabled()) if (printing.getSet()->getEnabled())
return true; return true;
} }
} }

View file

@ -316,10 +316,10 @@ void CardInfo::refreshCachedSetNames()
{ {
QStringList setList; QStringList setList;
// update the cached list of set names // update the cached list of set names
for (const auto &cardInfoPerSetList : sets) { for (const auto &printings : sets) {
for (const auto &set : cardInfoPerSetList) { for (const auto &printing : printings) {
if (set.getSet()->getEnabled()) { if (printing.getSet()->getEnabled()) {
setList << set.getSet()->getShortName(); setList << printing.getSet()->getShortName();
} }
break; break;
} }

View file

@ -130,9 +130,9 @@ static void setupParserRules()
const auto rarity = std::any_cast<QString>(sv[0]); const auto rarity = std::any_cast<QString>(sv[0]);
return [=](const CardData &x) -> bool { return [=](const CardData &x) -> bool {
QList<PrintingInfo> infos; QList<PrintingInfo> infos;
for (const auto &setsValue : x->getSets().values()) { for (const auto &printings : x->getSets()) {
for (const auto &cardInfoPerSet : setsValue) { for (const auto &printing : printings) {
infos.append(cardInfoPerSet); infos.append(printing);
} }
} }

View file

@ -215,8 +215,8 @@ bool FilterItem::acceptText(const CardInfoPtr info) const
bool FilterItem::acceptSet(const CardInfoPtr info) const bool FilterItem::acceptSet(const CardInfoPtr info) const
{ {
bool status = false; bool status = false;
for (const auto &cardInfoPerSetList : info->getSets()) { for (const auto &printings : info->getSets()) {
for (const auto &set : cardInfoPerSetList) { for (const auto &set : printings) {
if (set.getSet()->getShortName().compare(term, Qt::CaseInsensitive) == 0 || if (set.getSet()->getShortName().compare(term, Qt::CaseInsensitive) == 0 ||
set.getSet()->getLongName().compare(term, Qt::CaseInsensitive) == 0) { set.getSet()->getLongName().compare(term, Qt::CaseInsensitive) == 0) {
status = true; status = true;
@ -350,9 +350,9 @@ bool FilterItem::acceptRarity(const CardInfoPtr info) const
} }
} }
for (const auto &cardInfoPerSetList : info->getSets()) { for (const auto &printings : info->getSets()) {
for (const auto &set : cardInfoPerSetList) { for (const auto &printing : printings) {
if (set.getProperty("rarity").compare(converted_term, Qt::CaseInsensitive) == 0) { if (printing.getProperty("rarity").compare(converted_term, Qt::CaseInsensitive) == 0) {
return true; return true;
} }
} }