Improve set decode logic
This commit is contained in:
parent
d3ff426946
commit
46746aeebc
1 changed files with 3 additions and 3 deletions
|
@ -219,6 +219,7 @@ QJsonValue IppMsg::collect_attributes(QJsonArray& attrs)
|
||||||
}
|
}
|
||||||
else if(attrs.begin()->toObject()["tag"] == BeginCollection)
|
else if(attrs.begin()->toObject()["tag"] == BeginCollection)
|
||||||
{ // this is a 1setOf
|
{ // this is a 1setOf
|
||||||
|
attrs.pop_front();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -229,7 +230,6 @@ QJsonValue IppMsg::collect_attributes(QJsonArray& attrs)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qDebug() << "out of sync with collection" << tmpobj;
|
qDebug() << "out of sync with collection" << tmpobj;
|
||||||
Q_ASSERT("NOOOOO!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,10 +265,10 @@ QString IppMsg::consume_attribute(QJsonObject& attrs, Bytestream& data)
|
||||||
|
|
||||||
if(tag == BeginCollection)
|
if(tag == BeginCollection)
|
||||||
{
|
{
|
||||||
qDebug() << "Unnamed attrs for collection" << unnamed;
|
// qDebug() << "Unnamed attrs for collection" << unnamed;
|
||||||
|
|
||||||
QJsonValue collected = collect_attributes(unnamed);
|
QJsonValue collected = collect_attributes(unnamed);
|
||||||
qDebug() << "collected" << collected;
|
// qDebug() << "collected" << collected;
|
||||||
taggedValue = QJsonObject {{"tag", tag}, {"value", collected}};
|
taggedValue = QJsonObject {{"tag", tag}, {"value", collected}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue