[CardInfo] Refactor: remove properties setters

This commit is contained in:
RickyRister 2026-08-03 01:02:33 -07:00
parent 1ed9823b56
commit de125338da
8 changed files with 22 additions and 61 deletions

View file

@ -228,7 +228,6 @@ void CockatriceXml3Parser::loadCardsFromXml(QXmlStreamReader &xml)
// Only load printings from sets the user has enabled, matching the v4 loader's
// behaviour. Without this check, disabling a set has no effect on v3 databases.
if (set->getEnabled()) {
PrintingInfo setInfo(set);
QHash<QString, QString> printingProps;
if (attrs.hasAttribute("muId")) {
printingProps.insert("muid", attrs.value("muId").toString());
@ -249,7 +248,7 @@ void CockatriceXml3Parser::loadCardsFromXml(QXmlStreamReader &xml)
if (attrs.hasAttribute("rarity")) {
printingProps.insert("rarity", attrs.value("rarity").toString());
}
setInfo.setProperties(printingProps);
PrintingInfo setInfo(set, printingProps);
_sets[setName].append(setInfo);
}
// related cards

View file

@ -314,7 +314,6 @@ void CockatriceXml4Parser::loadCardsFromXml(QXmlStreamReader &xml)
QString setName = xml.readElementText(QXmlStreamReader::IncludeChildElements);
auto set = internalAddSet(setName);
if (set->getEnabled()) {
PrintingInfo printingInfo(set);
QHash<QString, QString> printingProps;
for (QXmlStreamAttribute attr : attrs) {
QString attrName = attr.name().toString();
@ -323,7 +322,7 @@ void CockatriceXml4Parser::loadCardsFromXml(QXmlStreamReader &xml)
}
printingProps.insert(attrName, attr.value().toString());
}
printingInfo.setProperties(printingProps);
PrintingInfo printingInfo(set, printingProps);
// This is very much a hack and not the right place to
// put this check, as it requires a reload of Cockatrice