Skip to content

Remove payload keys when no payload exists

Summary

qobject2qvariant always adds payloadSize and payloadTransferInfo keys to a NetworkPacket, because payloadSize and payloadTransferInfo are properties of NetworkPacket.

Why are the changes needed:

Test Plan

Before:

Add a debug message in KdeConnectPlugin::sendPacket like qCDebug(coreLogger) << "data:" << np.serialize().constData();. Message without a payload will contain "payloadSize":0,"payloadTransferInfo":{}.

After:

After the change "payloadSize":0,"payloadTransferInfo":{} will be not part of a message.

/label ~bugfix

Edited by Richard Liebscher

Merge request reports

Loading