[DeckListModel] Refactor: general code cleanup (#6460)

* change one usage

* move method

* move format check code

* make group criteria method static

* move method

* make method private

* more comments
This commit is contained in:
RickyRister 2025-12-31 03:01:49 -08:00 committed by GitHub
parent 968be8a06f
commit d722b2569c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 66 additions and 59 deletions

View file

@ -75,6 +75,16 @@ QString CardInfo::getCorrectedName() const
return result.remove(rmrx).replace(spacerx, space);
}
bool CardInfo::isLegalInFormat(const QString &format) const
{
if (format.isEmpty()) {
return true;
}
QString formatLegality = getProperty("format-" + format);
return formatLegality == "legal" || formatLegality == "restricted";
}
void CardInfo::addToSet(const CardSetPtr &_set, const PrintingInfo _info)
{
if (!_set->contains(smartThis)) {