mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -07:00
rename variables again
This commit is contained in:
parent
47434c64ee
commit
4f67e69390
7 changed files with 37 additions and 37 deletions
|
|
@ -28,9 +28,9 @@ PictureToLoad::PictureToLoad(CardInfoPtr _card)
|
|||
QList<CardSetPtr> PictureToLoad::extractSetsSorted(const CardInfoPtr &card)
|
||||
{
|
||||
QList<CardSetPtr> sortedSets;
|
||||
for (const auto &cardInfoPerSetList : card->getSets()) {
|
||||
for (const auto &set : cardInfoPerSetList) {
|
||||
sortedSets << set.getSet();
|
||||
for (const auto &printings : card->getSets()) {
|
||||
for (const auto &printing : printings) {
|
||||
sortedSets << printing.getSet();
|
||||
}
|
||||
}
|
||||
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 (!SettingsCache::instance().getOverrideAllCardArtWithPersonalPreference()) {
|
||||
// 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 &set : cardInfoPerSetList) {
|
||||
if (QLatin1String("card_") + card->getName() + QString("_") + QString(set.getProperty("uuid")) ==
|
||||
for (const auto &printings : card->getSets()) {
|
||||
for (const auto &printing : printings) {
|
||||
if (QLatin1String("card_") + card->getName() + QString("_") + QString(printing.getProperty("uuid")) ==
|
||||
card->getPixmapCacheKey()) {
|
||||
long long setIndex = sortedSets.indexOf(set.getSet());
|
||||
long long setIndex = sortedSets.indexOf(printing.getSet());
|
||||
CardSetPtr setForCardProviderID = sortedSets.takeAt(setIndex);
|
||||
sortedSets.prepend(setForCardProviderID);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,13 +99,13 @@ QList<PrintingInfo> PrintingSelectorCardSortingWidget::sortSets(const SetToPrint
|
|||
}
|
||||
|
||||
QList<PrintingInfo> sortedPrintings;
|
||||
// Reconstruct sorted list of CardInfoPerSet
|
||||
// Reconstruct sorted list of PrintingInfo
|
||||
for (const auto &set : sortedSets) {
|
||||
for (auto it = setMap.begin(); it != setMap.end(); ++it) {
|
||||
for (const auto &cardInfoPerSet : it.value()) {
|
||||
if (cardInfoPerSet.getSet() == set) {
|
||||
if (!sortedPrintings.contains(cardInfoPerSet)) {
|
||||
sortedPrintings << cardInfoPerSet;
|
||||
for (const auto &printingInfo : it.value()) {
|
||||
if (printingInfo.getSet() == set) {
|
||||
if (!sortedPrintings.contains(printingInfo)) {
|
||||
sortedPrintings << printingInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,12 +147,12 @@ CardInfoPtr CardDatabase::getCardByNameAndProviderId(const QString &cardName, co
|
|||
return info;
|
||||
}
|
||||
|
||||
for (const auto &cardInfoPerSetList : info->getSets()) {
|
||||
for (const auto &set : cardInfoPerSetList) {
|
||||
if (set.getProperty("uuid") == providerId) {
|
||||
for (const auto &printings : info->getSets()) {
|
||||
for (const auto &printing : printings) {
|
||||
if (printing.getProperty("uuid") == providerId) {
|
||||
CardInfoPtr cardFromSpecificSet = info->clone();
|
||||
cardFromSpecificSet->setPixmapCacheKey(QLatin1String("card_") + QString(info->getName()) +
|
||||
QString("_") + QString(set.getProperty("uuid")));
|
||||
QString("_") + QString(printing.getProperty("uuid")));
|
||||
return cardFromSpecificSet;
|
||||
}
|
||||
}
|
||||
|
|
@ -354,8 +354,8 @@ PrintingInfo CardDatabase::getSpecificPrinting(const QString &cardName, const QS
|
|||
return PrintingInfo(nullptr);
|
||||
}
|
||||
|
||||
for (const auto &cardInfoPerSetList : setMap) {
|
||||
for (auto &cardInfoForSet : cardInfoPerSetList) {
|
||||
for (const auto &printings : setMap) {
|
||||
for (auto &cardInfoForSet : printings) {
|
||||
if (cardInfoForSet.getProperty("uuid") == providerId) {
|
||||
return cardInfoForSet;
|
||||
}
|
||||
|
|
@ -383,8 +383,8 @@ PrintingInfo CardDatabase::getSpecificPrinting(const QString &cardName,
|
|||
return PrintingInfo(nullptr);
|
||||
}
|
||||
|
||||
for (const auto &cardInfoPerSetList : setMap) {
|
||||
for (auto &cardInfoForSet : cardInfoPerSetList) {
|
||||
for (const auto &printings : setMap) {
|
||||
for (auto &cardInfoForSet : printings) {
|
||||
if (collectorNumber != nullptr) {
|
||||
if (cardInfoForSet.getSet()->getShortName() == setShortName &&
|
||||
cardInfoForSet.getProperty("num") == collectorNumber) {
|
||||
|
|
@ -431,8 +431,8 @@ PrintingInfo CardDatabase::getSetInfoForCard(const CardInfoPtr &_card)
|
|||
return PrintingInfo(nullptr);
|
||||
}
|
||||
|
||||
for (const auto &cardInfoPerSetList : setMap) {
|
||||
for (const auto &cardInfoForSet : cardInfoPerSetList) {
|
||||
for (const auto &printings : setMap) {
|
||||
for (const auto &cardInfoForSet : printings) {
|
||||
if (QLatin1String("card_") + _card->getName() + QString("_") + cardInfoForSet.getProperty("uuid") ==
|
||||
_card->getPixmapCacheKey()) {
|
||||
return cardInfoForSet;
|
||||
|
|
|
|||
|
|
@ -98,9 +98,9 @@ bool CardDatabaseModel::checkCardHasAtLeastOneEnabledSet(CardInfoPtr card)
|
|||
if (!showOnlyCardsFromEnabledSets)
|
||||
return true;
|
||||
|
||||
for (const auto &cardInfoPerSetList : card->getSets()) {
|
||||
for (const auto &set : cardInfoPerSetList) {
|
||||
if (set.getSet()->getEnabled())
|
||||
for (const auto &printings : card->getSets()) {
|
||||
for (const auto &printing : printings) {
|
||||
if (printing.getSet()->getEnabled())
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -316,10 +316,10 @@ void CardInfo::refreshCachedSetNames()
|
|||
{
|
||||
QStringList setList;
|
||||
// update the cached list of set names
|
||||
for (const auto &cardInfoPerSetList : sets) {
|
||||
for (const auto &set : cardInfoPerSetList) {
|
||||
if (set.getSet()->getEnabled()) {
|
||||
setList << set.getSet()->getShortName();
|
||||
for (const auto &printings : sets) {
|
||||
for (const auto &printing : printings) {
|
||||
if (printing.getSet()->getEnabled()) {
|
||||
setList << printing.getSet()->getShortName();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,9 +130,9 @@ static void setupParserRules()
|
|||
const auto rarity = std::any_cast<QString>(sv[0]);
|
||||
return [=](const CardData &x) -> bool {
|
||||
QList<PrintingInfo> infos;
|
||||
for (const auto &setsValue : x->getSets().values()) {
|
||||
for (const auto &cardInfoPerSet : setsValue) {
|
||||
infos.append(cardInfoPerSet);
|
||||
for (const auto &printings : x->getSets()) {
|
||||
for (const auto &printing : printings) {
|
||||
infos.append(printing);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -215,8 +215,8 @@ bool FilterItem::acceptText(const CardInfoPtr info) const
|
|||
bool FilterItem::acceptSet(const CardInfoPtr info) const
|
||||
{
|
||||
bool status = false;
|
||||
for (const auto &cardInfoPerSetList : info->getSets()) {
|
||||
for (const auto &set : cardInfoPerSetList) {
|
||||
for (const auto &printings : info->getSets()) {
|
||||
for (const auto &set : printings) {
|
||||
if (set.getSet()->getShortName().compare(term, Qt::CaseInsensitive) == 0 ||
|
||||
set.getSet()->getLongName().compare(term, Qt::CaseInsensitive) == 0) {
|
||||
status = true;
|
||||
|
|
@ -350,9 +350,9 @@ bool FilterItem::acceptRarity(const CardInfoPtr info) const
|
|||
}
|
||||
}
|
||||
|
||||
for (const auto &cardInfoPerSetList : info->getSets()) {
|
||||
for (const auto &set : cardInfoPerSetList) {
|
||||
if (set.getProperty("rarity").compare(converted_term, Qt::CaseInsensitive) == 0) {
|
||||
for (const auto &printings : info->getSets()) {
|
||||
for (const auto &printing : printings) {
|
||||
if (printing.getProperty("rarity").compare(converted_term, Qt::CaseInsensitive) == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue