Remove payload keys when no payload exists
This commit is contained in:
parent
6883d46cb4
commit
5c0ad3fb85
1 changed files with 3 additions and 8 deletions
|
@ -87,16 +87,11 @@ QVariantMap qobject2qvariant(const T* object)
|
||||||
QByteArray NetworkPacket::serialize() const
|
QByteArray NetworkPacket::serialize() const
|
||||||
{
|
{
|
||||||
//Object -> QVariant
|
//Object -> QVariant
|
||||||
//QVariantMap variant;
|
|
||||||
//variant["id"] = mId;
|
|
||||||
//variant["type"] = mType;
|
|
||||||
//variant["body"] = mBody;
|
|
||||||
QVariantMap variant = qobject2qvariant(this);
|
QVariantMap variant = qobject2qvariant(this);
|
||||||
|
|
||||||
if (hasPayload()) {
|
if (!hasPayload()) {
|
||||||
//qCDebug(KDECONNECT_CORE) << "Serializing payloadTransferInfo";
|
variant.remove(QStringLiteral("payloadSize"));
|
||||||
variant[QStringLiteral("payloadSize")] = payloadSize();
|
variant.remove(QStringLiteral("payloadTransferInfo"));
|
||||||
variant[QStringLiteral("payloadTransferInfo")] = m_payloadTransferInfo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//QVariant -> json
|
//QVariant -> json
|
||||||
|
|
Loading…
Reference in a new issue