Merge pull request #28 from vigejolla/getattr-fix
IppMsg: Don't encode job attributes if there are none
This commit is contained in:
commit
fe4e24ab3b
1 changed files with 7 additions and 5 deletions
|
@ -199,14 +199,16 @@ QByteArray IppMsg::encode(Operation op)
|
|||
}
|
||||
for(QJsonArray::iterator ait = _jobAttrs.begin(); ait != _jobAttrs.end(); ait++)
|
||||
{
|
||||
ipp << quint8(2);
|
||||
QJsonObject tmpObj = ait->toObject();
|
||||
if (!tmpObj.isEmpty()) {
|
||||
ipp << quint8(2);
|
||||
for(QJsonObject::iterator it = tmpObj.begin(); it != tmpObj.end(); it++)
|
||||
{
|
||||
QJsonObject val = it.value().toObject();
|
||||
ipp << encode_attr(val["tag"].toInt(), it.key(), val["value"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ipp << quint8(3);
|
||||
|
||||
|
|
Loading…
Reference in a new issue