mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
XML fix
This commit is contained in:
parent
e51aa20420
commit
207d10d3e2
9 changed files with 73 additions and 70 deletions
|
|
@ -73,18 +73,15 @@ void ServerSocketInterface::readClient()
|
|||
qDebug() << data;
|
||||
xmlReader->addData(data);
|
||||
|
||||
if (topLevelItem)
|
||||
topLevelItem->read(xmlReader);
|
||||
else
|
||||
while (!xmlReader->atEnd()) {
|
||||
xmlReader->readNext();
|
||||
if (xmlReader->isStartElement() && (xmlReader->name().toString() == "cockatrice_client_stream")) {
|
||||
topLevelItem = new TopLevelProtocolItem;
|
||||
connect(topLevelItem, SIGNAL(protocolItemReceived(ProtocolItem *)), this, SLOT(processProtocolItem(ProtocolItem *)));
|
||||
|
||||
topLevelItem->read(xmlReader);
|
||||
}
|
||||
while (!xmlReader->atEnd()) {
|
||||
xmlReader->readNext();
|
||||
if (topLevelItem)
|
||||
topLevelItem->readElement(xmlReader);
|
||||
else if (xmlReader->isStartElement() && (xmlReader->name().toString() == "cockatrice_client_stream")) {
|
||||
topLevelItem = new TopLevelProtocolItem;
|
||||
connect(topLevelItem, SIGNAL(protocolItemReceived(ProtocolItem *)), this, SLOT(processProtocolItem(ProtocolItem *)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ServerSocketInterface::catchSocketError(QAbstractSocket::SocketError socketError)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue