fix XML processing
This commit is contained in:
parent
0249ce7043
commit
af607bd8a2
2 changed files with 17 additions and 4 deletions
10
nvhttp.cpp
10
nvhttp.cpp
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue