Renamed !setnumber! to !collectornumber!
This commit is contained in:
parent
da2eb97c7b
commit
ae456a5bc3
3 changed files with 15 additions and 12 deletions
|
@ -185,7 +185,7 @@ CardInfo::CardInfo(const QString &_name,
|
||||||
const SetList &_sets,
|
const SetList &_sets,
|
||||||
const QStringMap &_customPicURLs,
|
const QStringMap &_customPicURLs,
|
||||||
MuidMap _muIds,
|
MuidMap _muIds,
|
||||||
QStringMap _setNumbers,
|
QStringMap _collectorNumbers,
|
||||||
QStringMap _rarities
|
QStringMap _rarities
|
||||||
)
|
)
|
||||||
: name(_name),
|
: name(_name),
|
||||||
|
@ -204,7 +204,7 @@ CardInfo::CardInfo(const QString &_name,
|
||||||
loyalty(_loyalty),
|
loyalty(_loyalty),
|
||||||
customPicURLs(_customPicURLs),
|
customPicURLs(_customPicURLs),
|
||||||
muIds(_muIds),
|
muIds(_muIds),
|
||||||
setNumbers(_setNumbers),
|
collectorNumbers(_collectorNumbers),
|
||||||
rarities(_rarities),
|
rarities(_rarities),
|
||||||
cipt(_cipt),
|
cipt(_cipt),
|
||||||
tableRow(_tableRow)
|
tableRow(_tableRow)
|
||||||
|
@ -333,9 +333,9 @@ static QXmlStreamWriter &operator<<(QXmlStreamWriter &xml, const CardInfo *info)
|
||||||
xml.writeAttribute("rarity", info->getRarity(tmpSet));
|
xml.writeAttribute("rarity", info->getRarity(tmpSet));
|
||||||
xml.writeAttribute("muId", QString::number(info->getMuId(tmpSet)));
|
xml.writeAttribute("muId", QString::number(info->getMuId(tmpSet)));
|
||||||
|
|
||||||
tmpString = info->getSetNumber(tmpSet);
|
tmpString = info->getCollectorNumber(tmpSet);
|
||||||
if(!tmpString.isEmpty())
|
if(!tmpString.isEmpty())
|
||||||
xml.writeAttribute("num", info->getSetNumber(tmpSet));
|
xml.writeAttribute("num", info->getCollectorNumber(tmpSet));
|
||||||
|
|
||||||
tmpString = info->getCustomPicURL(tmpSet);
|
tmpString = info->getCustomPicURL(tmpSet);
|
||||||
if(!tmpString.isEmpty())
|
if(!tmpString.isEmpty())
|
||||||
|
@ -508,7 +508,7 @@ void CardDatabase::loadCardsFromXml(QXmlStreamReader &xml)
|
||||||
QStringList colors, relatedCards, reverseRelatedCards;
|
QStringList colors, relatedCards, reverseRelatedCards;
|
||||||
QStringMap customPicURLs;
|
QStringMap customPicURLs;
|
||||||
MuidMap muids;
|
MuidMap muids;
|
||||||
QStringMap setNumbers, rarities;
|
QStringMap collectorNumbers, rarities;
|
||||||
SetList sets;
|
SetList sets;
|
||||||
int tableRow = 0;
|
int tableRow = 0;
|
||||||
int loyalty = 0;
|
int loyalty = 0;
|
||||||
|
@ -541,7 +541,7 @@ void CardDatabase::loadCardsFromXml(QXmlStreamReader &xml)
|
||||||
customPicURLs[setName] = attrs.value("picURL").toString();
|
customPicURLs[setName] = attrs.value("picURL").toString();
|
||||||
}
|
}
|
||||||
if (attrs.hasAttribute("num")) {
|
if (attrs.hasAttribute("num")) {
|
||||||
setNumbers[setName] = attrs.value("num").toString();
|
collectorNumbers[setName] = attrs.value("num").toString();
|
||||||
}
|
}
|
||||||
if (attrs.hasAttribute("rarity")) {
|
if (attrs.hasAttribute("rarity")) {
|
||||||
rarities[setName] = attrs.value("rarity").toString();
|
rarities[setName] = attrs.value("rarity").toString();
|
||||||
|
@ -568,7 +568,7 @@ void CardDatabase::loadCardsFromXml(QXmlStreamReader &xml)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addCard(new CardInfo(name, isToken, manacost, cmc, type, pt, text, colors, relatedCards, reverseRelatedCards, upsideDown, loyalty, cipt, tableRow, sets, customPicURLs, muids, setNumbers, rarities));
|
addCard(new CardInfo(name, isToken, manacost, cmc, type, pt, text, colors, relatedCards, reverseRelatedCards, upsideDown, loyalty, cipt, tableRow, sets, customPicURLs, muids, collectorNumbers, rarities));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ private:
|
||||||
int loyalty;
|
int loyalty;
|
||||||
QStringMap customPicURLs;
|
QStringMap customPicURLs;
|
||||||
MuidMap muIds;
|
MuidMap muIds;
|
||||||
QStringMap setNumbers;
|
QStringMap collectorNumbers;
|
||||||
QStringMap rarities;
|
QStringMap rarities;
|
||||||
bool cipt;
|
bool cipt;
|
||||||
int tableRow;
|
int tableRow;
|
||||||
|
@ -111,7 +111,7 @@ public:
|
||||||
const SetList &_sets = SetList(),
|
const SetList &_sets = SetList(),
|
||||||
const QStringMap &_customPicURLs = QStringMap(),
|
const QStringMap &_customPicURLs = QStringMap(),
|
||||||
MuidMap muids = MuidMap(),
|
MuidMap muids = MuidMap(),
|
||||||
QStringMap _setNumbers = QStringMap(),
|
QStringMap _collectorNumbers = QStringMap(),
|
||||||
QStringMap _rarities = QStringMap()
|
QStringMap _rarities = QStringMap()
|
||||||
);
|
);
|
||||||
~CardInfo();
|
~CardInfo();
|
||||||
|
@ -144,7 +144,7 @@ public:
|
||||||
bool getUpsideDownArt() const { return upsideDownArt; }
|
bool getUpsideDownArt() const { return upsideDownArt; }
|
||||||
QString getCustomPicURL(const QString &set) const { return customPicURLs.value(set); }
|
QString getCustomPicURL(const QString &set) const { return customPicURLs.value(set); }
|
||||||
int getMuId(const QString &set) const { return muIds.value(set); }
|
int getMuId(const QString &set) const { return muIds.value(set); }
|
||||||
QString getSetNumber(const QString &set) const { return setNumbers.value(set); }
|
QString getCollectorNumber(const QString &set) const { return collectorNumbers.value(set); }
|
||||||
QString getRarity(const QString &set) const { return rarities.value(set); }
|
QString getRarity(const QString &set) const { return rarities.value(set); }
|
||||||
QStringMap getRarities() const { return rarities; }
|
QStringMap getRarities() const { return rarities; }
|
||||||
QString getMainCardType() const;
|
QString getMainCardType() const;
|
||||||
|
@ -154,7 +154,7 @@ public:
|
||||||
void setLoyalty(int _loyalty) { loyalty = _loyalty; emit cardInfoChanged(this); }
|
void setLoyalty(int _loyalty) { loyalty = _loyalty; emit cardInfoChanged(this); }
|
||||||
void setCustomPicURL(const QString &_set, const QString &_customPicURL) { customPicURLs.insert(_set, _customPicURL); }
|
void setCustomPicURL(const QString &_set, const QString &_customPicURL) { customPicURLs.insert(_set, _customPicURL); }
|
||||||
void setMuId(const QString &_set, const int &_muId) { muIds.insert(_set, _muId); }
|
void setMuId(const QString &_set, const int &_muId) { muIds.insert(_set, _muId); }
|
||||||
void setSetNumber(const QString &_set, const QString &_setNumber) { setNumbers.insert(_set, _setNumber); }
|
void setSetNumber(const QString &_set, const QString &_setNumber) { collectorNumbers.insert(_set, _setNumber); }
|
||||||
void setRarity(const QString &_set, const QString &_setNumber) { rarities.insert(_set, _setNumber); }
|
void setRarity(const QString &_set, const QString &_setNumber) { rarities.insert(_set, _setNumber); }
|
||||||
void addToSet(CardSet *set);
|
void addToSet(CardSet *set);
|
||||||
void emitPixmapUpdated() { emit pixmapUpdated(); }
|
void emitPixmapUpdated() { emit pixmapUpdated(); }
|
||||||
|
|
|
@ -220,7 +220,10 @@ QString PictureLoaderWorker::getPicUrl()
|
||||||
picUrl.replace("!cardid!", QUrl::toPercentEncoding(QString::number(muid)));
|
picUrl.replace("!cardid!", QUrl::toPercentEncoding(QString::number(muid)));
|
||||||
if (set)
|
if (set)
|
||||||
{
|
{
|
||||||
picUrl.replace("!setnumber!", QUrl::toPercentEncoding(card->getSetNumber(set->getShortName())));
|
// renamed from !setnumber! to !collectornumber! on 20160819. Remove the old one when convenient.
|
||||||
|
picUrl.replace("!setnumber!", QUrl::toPercentEncoding(card->getCollectorNumber(set->getShortName())));
|
||||||
|
picUrl.replace("!collectornumber!", QUrl::toPercentEncoding(card->getCollectorNumber(set->getShortName())));
|
||||||
|
|
||||||
picUrl.replace("!setcode!", QUrl::toPercentEncoding(set->getShortName()));
|
picUrl.replace("!setcode!", QUrl::toPercentEncoding(set->getShortName()));
|
||||||
picUrl.replace("!setcode_lower!", QUrl::toPercentEncoding(set->getShortName().toLower()));
|
picUrl.replace("!setcode_lower!", QUrl::toPercentEncoding(set->getShortName().toLower()));
|
||||||
picUrl.replace("!setname!", QUrl::toPercentEncoding(set->getLongName()));
|
picUrl.replace("!setname!", QUrl::toPercentEncoding(set->getLongName()));
|
||||||
|
|
Loading…
Reference in a new issue