aboutsummaryrefslogtreecommitdiffstats
path: root/app/taskmanager.cpp
diff options
context:
space:
mode:
authorVitaly Wool <vitaly.wool@konsulko.com>2019-02-05 18:54:46 +0100
committerVitaly Wool <vitaly.wool@konsulko.com>2019-02-05 23:20:36 +0100
commit9a338344f1a892fd188d80e71038634e4ee5096e (patch)
tree89c8dcab7ca3dfbd6bb0b2c23f4e28f05d64e10d /app/taskmanager.cpp
parent326a4e5f9685f17ef30345457ce1aca5753a5a04 (diff)
binding: act upon messageType
For each reply message coming from agl-service-taskmanager, read out messageType parameter and act upon it. Change-Id: Ie2da3e54c46071e14e213b838254e0af932ad86f Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com>
Diffstat (limited to 'app/taskmanager.cpp')
-rw-r--r--app/taskmanager.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/app/taskmanager.cpp b/app/taskmanager.cpp
index 03a39bb..3b0d1e7 100644
--- a/app/taskmanager.cpp
+++ b/app/taskmanager.cpp
@@ -54,10 +54,21 @@ void TaskManager::onMessageReceived(MessageType type, Message *message)
void TaskManager::ProcessResponse(Message *message)
{
- std::vector<ProcInfo> procs;
-
qDebug() << "got message " << message->toJson();
- QJsonArray processes = message->replyData()["processes"].toArray();
+ QString msgType = message->replyData()["msgType"].toString();
+ if (msgType.isNull())
+ return; // no type supplied, ignoring
+
+ if (QString::compare(msgType, "processList") == 0) {
+ QJsonArray processes = message->replyData()["processes"].toArray();
+ ProcessResponseTasklist(processes);
+ }
+ // more response types to follow
+}
+
+void TaskManager::ProcessResponseTasklist(QJsonArray& processes)
+{
+ std::vector<ProcInfo> procs;
if (processes.size() == 0) {
// this is not a valid process list response