Minor cleanup

This commit is contained in:
ZeldaZach 2024-12-01 11:53:46 -05:00
parent 322d61e7ef
commit 4a75eac3d3
No known key found for this signature in database
9 changed files with 37 additions and 50 deletions

View file

@ -32,8 +32,8 @@ PictureToLoad::PictureToLoad(CardInfoPtr _card)
: card(std::move(_card)), urlTemplates(SettingsCache::instance().downloads().getAllURLs())
{
if (card) {
for (const auto &x : card->getSets()) {
for (const auto &set : x) {
for (const auto &cardInfoPerSetList : card->getSets()) {
for (const auto &set : cardInfoPerSetList) {
sortedSets << set.getPtr();
}
}
@ -45,8 +45,8 @@ PictureToLoad::PictureToLoad(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 &x : card->getSets()) {
for (const auto &set : x) {
for (const auto &cardInfoPerSetList : card->getSets()) {
for (const auto &set : cardInfoPerSetList) {
if (QLatin1String("card_") + card->getName() + QString("_") + QString(set.getProperty("uuid")) ==
card->getPixmapCacheKey()) {
long long setIndex = sortedSets.indexOf(set.getPtr());

View file

@ -116,8 +116,8 @@ CardInfoPerSet PrintingSelector::getSetForUUID(const QString &uuid)
{
CardInfoPerSetMap cardInfoPerSets = selectedCard->getSets();
for (const auto &x : cardInfoPerSets) {
for (const auto &cardInfoPerSet : x) {
for (const auto &cardInfoPerSetList : cardInfoPerSets) {
for (const auto &cardInfoPerSet : cardInfoPerSetList) {
if (cardInfoPerSet.getProperty("uuid") == uuid) {
return cardInfoPerSet;
}

View file

@ -44,8 +44,8 @@ QList<CardInfoPerSet> PrintingSelectorCardSortingWidget::sortSets(CardInfoPerSet
{
QList<CardSetPtr> sortedSets;
for (const auto &x : cardInfoPerSets) {
for (const auto &set : x) {
for (const auto &cardInfoPerSetList : cardInfoPerSets) {
for (const auto &set : cardInfoPerSetList) {
sortedSets << set.getPtr();
break;
}
@ -66,8 +66,8 @@ QList<CardInfoPerSet> PrintingSelectorCardSortingWidget::sortSets(CardInfoPerSet
// Reconstruct sorted list of CardInfoPerSet
for (const auto &set : sortedSets) {
for (auto it = cardInfoPerSets.begin(); it != cardInfoPerSets.end(); ++it) {
for (const auto &x : it.value()) {
if (x.getPtr() == set) {
for (const auto &cardInfoPerSet : it.value()) {
if (cardInfoPerSet.getPtr() == set) {
sortedCardInfoPerSets << it.value();
break;
}
@ -115,8 +115,8 @@ QList<CardInfoPerSet> PrintingSelectorCardSortingWidget::prependPrintingsInDeck(
QList<QPair<CardInfoPerSet, int>> countList;
// Collect sets with their counts
for (const auto &x : cardInfoPerSets) {
for (const auto &cardInfoPerSet : x) {
for (const auto &cardInfoPerSetList : cardInfoPerSets) {
for (const auto &cardInfoPerSet : cardInfoPerSetList) {
QModelIndex find_card =
deckModel->findCard(selectedCard->getName(), DECK_ZONE_MAIN, cardInfoPerSet.getProperty("uuid"));
if (find_card.isValid()) {