fix bug introduced in #5267 (#5270)

* fix bug introduced in #5267

* remove default args to prevent similar bugs in the future

* add newInstance overload with default properties
This commit is contained in:
RickyRister 2024-12-19 05:17:09 -08:00 committed by GitHub
parent dde2f8b9ad
commit 5bbc118920
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 36 additions and 24 deletions

View file

@ -202,17 +202,17 @@ private:
bool upsideDownArt;
public:
explicit CardInfo(const QString &_name = QString(),
const QString &_text = QString(),
bool _isToken = false,
QVariantHash _properties = QVariantHash(),
const QList<CardRelation *> &_relatedCards = QList<CardRelation *>(),
const QList<CardRelation *> &_reverseRelatedCards = QList<CardRelation *>(),
CardInfoPerSetMap _sets = CardInfoPerSetMap(),
bool _cipt = false,
bool _landscapeOrientation = false,
int _tableRow = 0,
bool _upsideDownArt = false);
explicit CardInfo(const QString &_name,
const QString &_text,
bool _isToken,
QVariantHash _properties,
const QList<CardRelation *> &_relatedCards,
const QList<CardRelation *> &_reverseRelatedCards,
CardInfoPerSetMap _sets,
bool _cipt,
bool _landscapeOrientation,
int _tableRow,
bool _upsideDownArt);
CardInfo(const CardInfo &other)
: QObject(other.parent()), name(other.name), simpleName(other.simpleName), pixmapCacheKey(other.pixmapCacheKey),
text(other.text), isToken(other.isToken), properties(other.properties), relatedCards(other.relatedCards),
@ -223,17 +223,19 @@ public:
}
~CardInfo() override;
static CardInfoPtr newInstance(const QString &_name = QString(),
const QString &_text = QString(),
bool _isToken = false,
QVariantHash _properties = QVariantHash(),
const QList<CardRelation *> &_relatedCards = QList<CardRelation *>(),
const QList<CardRelation *> &_reverseRelatedCards = QList<CardRelation *>(),
CardInfoPerSetMap _sets = CardInfoPerSetMap(),
bool _cipt = false,
bool _landscapeOrientation = false,
int _tableRow = 0,
bool _upsideDownArt = false);
static CardInfoPtr newInstance(const QString &_name);
static CardInfoPtr newInstance(const QString &_name,
const QString &_text,
bool _isToken,
QVariantHash _properties,
const QList<CardRelation *> &_relatedCards,
const QList<CardRelation *> &_reverseRelatedCards,
CardInfoPerSetMap _sets,
bool _cipt,
bool _landscapeOrientation,
int _tableRow,
bool _upsideDownArt);
CardInfoPtr clone() const
{