improved importer

This commit is contained in:
Max-Wilhelm Bruker 2009-10-17 17:13:55 +02:00
parent aae2c437d6
commit 3c8f2b878b
9 changed files with 160 additions and 93 deletions

View file

@ -98,8 +98,9 @@ QString CardInfo::getMainCardType() const
QString CardInfo::getCorrectedName() const
{
QString result = name;
// Fire // Ice, Circle of Protection: Red
return getName().remove(" // ").remove(":");
return result.remove(" // ").remove(":");
}
void CardInfo::addToSet(CardSet *set)
@ -204,10 +205,10 @@ QXmlStreamWriter &operator<<(QXmlStreamWriter &xml, const CardInfo *info)
xml.writeStartElement("card");
xml.writeTextElement("name", info->getName());
SetList sets = info->getSets();
const SetList &sets = info->getSets();
for (int i = 0; i < sets.size(); i++)
xml.writeTextElement("set", sets[i]->getShortName());
QStringList colors = info->getColors();
const QStringList &colors = info->getColors();
for (int i = 0; i < colors.size(); i++)
xml.writeTextElement("color", colors[i]);