diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2018-04-04 21:20:30 -0700 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2018-04-18 15:48:59 -0700 |
commit | c2912031a5faa821cf3ba3e24f0a496a732e81e8 (patch) | |
tree | 36e20e2f4bc3104d289ffb268eb98fcbc5724a74 | |
parent | 8f56bee416e1256edde2d6b463bec9e513911a33 (diff) |
libqtappfw: add response data reporting
Report back response data that respective messages can process and emit
via QT signals
Bug-AGL: SPEC-1385
Change-Id: I2a82dd9b85855a20fdd8f03cb82ad5ac0920d8c4
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
-rw-r--r-- | message.cpp | 5 | ||||
-rw-r--r-- | message.h | 14 |
2 files changed, 17 insertions, 2 deletions
diff --git a/message.cpp b/message.cpp index 014e8e7..95bc586 100644 --- a/message.cpp +++ b/message.cpp @@ -103,7 +103,12 @@ bool Message::fromJDoc(QJsonDocument jdoc) return false; } auto status_iter = request.find("status"); + auto info_iter = request.find("info"); + auto response_iter = payload.find("response"); + auto response = response_iter.value().toObject(); m_reply_status = status_iter.value().toString(); + m_reply_info = info_iter.value().toString(); + m_reply_data = response; m_reply = true; } else if (msgid == Event) { // If event, save data object @@ -63,6 +63,16 @@ class Message : public QObject return m_event_data; } + inline QString replyInfo() const + { + return m_reply_info; + } + + inline QJsonObject replyData() const + { + return m_reply_data; + } + inline bool isEvent() const { return m_event; @@ -80,9 +90,9 @@ class Message : public QObject protected: bool m_event, m_init, m_reply; - QString m_event_api, m_event_name, m_reply_status, m_reply_uuid; + QString m_event_api, m_event_name, m_reply_info, m_reply_status, m_reply_uuid; QJsonDocument m_jdoc; - QJsonObject m_event_data; + QJsonObject m_event_data, m_reply_data; }; #endif // MESSAGE_H |