summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/taskmanager.cpp17
-rw-r--r--app/taskmanager.h1
2 files changed, 15 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
diff --git a/app/taskmanager.h b/app/taskmanager.h
index 4049f9b..a874c22 100644
--- a/app/taskmanager.h
+++ b/app/taskmanager.h
@@ -38,6 +38,7 @@ private:
std::vector<ProcInfo> m_procinfos;
void ProcessResponse(Message *message);
+ void ProcessResponseTasklist(QJsonArray& processes);
};
#endif // TASKMANAGER_H