fix XML processing

This commit is contained in:
Cameron Gutman
2018-04-29 00:55:18 -07:00
parent 0249ce7043
commit af607bd8a2
2 changed files with 17 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
#include "nvhttp.h"
#include <QDebug>
#include <QUuid>
#include <QtNetwork/QNetworkReply>
#include <QEventLoop>
@@ -160,11 +161,16 @@ NvHTTP::getXmlString(QString xml,
{
QXmlStreamReader xmlReader(xml);
while (xmlReader.readNextStartElement())
while (!xmlReader.atEnd())
{
if (xmlReader.readNext() != QXmlStreamReader::StartElement)
{
continue;
}
if (xmlReader.name() == tagName)
{
return xmlReader.text().toString();
return xmlReader.readElementText();
}
}