From 1439b983b53cae505e0c89a5d0fa0266e45055c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Sat, 15 Nov 2025 15:50:43 +0100 Subject: [PATCH] More fixes. Took 7 minutes --- .../card_picture_loader/card_picture_to_load.cpp | 13 +++++++++++++ .../card_picture_loader/card_picture_to_load.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/cockatrice/src/interface/card_picture_loader/card_picture_to_load.cpp b/cockatrice/src/interface/card_picture_loader/card_picture_to_load.cpp index 1ba1a9ca3..d72226aab 100644 --- a/cockatrice/src/interface/card_picture_loader/card_picture_to_load.cpp +++ b/cockatrice/src/interface/card_picture_loader/card_picture_to_load.cpp @@ -46,6 +46,19 @@ QList CardPictureToLoad::extractSetsSorted(const ExactCard &card) return sortedSets; } +/** + * Finds the PrintingInfo corresponding to the exactCards's card name that belongs to a given set and has the + * exactCards's providerId. + * If the set name is in the CardInfo, but no printings in that set match the card's providerId, then the first + * PrintingInfo for the set is returned. + * + * This method only exists to maintain existing behavior. + * TODO: check if going through all sets is still necessary after the ExactCard refactor. + * + * @param card The card to look in + * @param setName The set's short name + * @return A PrintingInfo, or a default-constructed PrintingInfo if the set name is not in the CardInfo. + */ static PrintingInfo findPrintingForSet(const ExactCard &card, const QString &setName) { SetToPrintingsMap setsToPrintings = card.getInfo().getSets(); diff --git a/cockatrice/src/interface/card_picture_loader/card_picture_to_load.h b/cockatrice/src/interface/card_picture_loader/card_picture_to_load.h index c523628e7..99407b4bb 100644 --- a/cockatrice/src/interface/card_picture_loader/card_picture_to_load.h +++ b/cockatrice/src/interface/card_picture_loader/card_picture_to_load.h @@ -69,6 +69,7 @@ public: * @return True if a next set exists and was selected, false if at the end. * * Updates currentSet and repopulates currentSetUrls. + * If we are already at the end of the list, then currentSet is set to empty. */ bool nextSet(); @@ -77,6 +78,7 @@ public: * @return True if a next URL exists, false if at the end. * * Updates currentUrl. + * If we are already at the end of the list, then currentUrl is set to empty. */ bool nextUrl();