Allow JSONObject in a NetworkPacket
ClosedPublic

Authored by sredman on Apr 1 2018, 5:56 PM.

Details

Summary

Allow a mapping of fields to be a field of a NetworkPacket

Diff Detail

Repository
R225 KDE Connect - Android application
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sredman created this revision.Apr 1 2018, 5:56 PM
Restricted Application added a project: KDE Connect. · View Herald TranscriptApr 1 2018, 5:56 PM
sredman requested review of this revision.Apr 1 2018, 5:56 PM
sredman added a subscriber: KDE Connect.

This looks like a good idea.

Do you have the desktop-side implementation? We will need them both for this to be of use.

This looks like a good idea.

Do you have the desktop-side implementation? We will need them both for this to be of use.

Wouldn't np.get<QVariantMap>("key") work? I can't remember if I actually tested it.... As soon as I had the packet on the desktop side I realized I needed a list instead of a map.

(See the comment on line 66 of core/networkpacket.h: "Important note: Awesome template syntax is awesome")

albertvaka accepted this revision.Apr 2 2018, 6:48 PM

Indeed, that should work. I forgot we don't need type-specific getters and setters in Qt.

This revision is now accepted and ready to land.Apr 2 2018, 6:48 PM
This revision was automatically updated to reflect the committed changes.