fixed packet length calculation bug, re-enabled deck selection

This commit is contained in:
Max-Wilhelm Bruker 2011-12-18 19:10:47 +01:00
parent 314f17091d
commit 38e4781624
7 changed files with 30 additions and 11 deletions

View file

@ -267,6 +267,15 @@ DeckList::DeckList(DeckList *other)
updateDeckHash();
}
DeckList::DeckList(const QString &nativeString)
: SerializableItem("cockatrice_deck"), currentZone(0), currentSideboardPlan(0)
{
root = new InnerDecklistNode;
QXmlStreamReader xml(nativeString);
loadFromXml(&xml);
}
DeckList::~DeckList()
{
delete root;
@ -360,6 +369,16 @@ void DeckList::loadFromXml(QXmlStreamReader *xml)
updateDeckHash();
}
QString DeckList::writeToString_Native()
{
QString result;
QXmlStreamWriter xml(&result);
xml.writeStartDocument();
write(&xml);
xml.writeEndDocument();
return result;
}
bool DeckList::loadFromFile_Native(QIODevice *device)
{
QXmlStreamReader xml(device);