summaryrefslogtreecommitdiffstats
path: root/app/taskmanager.h
diff options
context:
space:
mode:
authorVitaly Wool <vitaly.wool@konsulko.com>2018-12-03 21:18:49 +0000
committerVitaly Wool <vitaly.wool@konsulko.com>2018-12-03 21:20:42 +0000
commit2e03aeb732646f30c4a946a894e29eefb256b586 (patch)
treebd8ddd5148a0b2a20c22333ebe31d2de2b67ad8c /app/taskmanager.h
parentd466bf191f581f4e3a3d1988845bffad01f7b3e1 (diff)
taskmanager: comunicate using libqtappfw
Use libqtappfw to avoid dealing with websocket protocol directly. Change-Id: I67813b38ffba3e54d52e61f60644ee101426e38a Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com>
Diffstat (limited to 'app/taskmanager.h')
-rw-r--r--app/taskmanager.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/app/taskmanager.h b/app/taskmanager.h
index da4f725..4049f9b 100644
--- a/app/taskmanager.h
+++ b/app/taskmanager.h
@@ -4,7 +4,7 @@
#include <QStringList>
#include <QVector>
#include <QtCore>
-#include <QWebSocket>
+#include <messageengine.h>
#include "procinfo.h"
#ifndef TASKMANAGER_H
@@ -15,11 +15,12 @@ class TaskManager : public QObject
Q_OBJECT
public:
- explicit TaskManager(QObject* parent = nullptr);
+ explicit TaskManager(QObject* parent = nullptr);
+ virtual ~TaskManager();
- Q_INVOKABLE void open(const QUrl& url);
- Q_INVOKABLE void kill(int tid);
- QTimer *timer;
+ Q_INVOKABLE void open(const QUrl& url);
+ Q_INVOKABLE void kill(int tid);
+ QTimer *timer;
signals:
void updateProcess(const QString& cmd_, int tid_, int euid_, double scpu_, double ucpu_, double resident_memory_, const QString& state_);
@@ -29,14 +30,14 @@ signals:
private slots:
void query();
void callService(const QString& ccommand, QJsonValue value);
- void onSocketTextReceived(QString msg);
+ void onConnected();
+ void onMessageReceived(MessageType type, Message *message);
private:
- QWebSocket m_socket;
- int m_nextCallId;
+ MessageEngine *m_loop;
std::vector<ProcInfo> m_procinfos;
- void ProcessResponse(bool r, const QJsonValue &val);
+ void ProcessResponse(Message *message);
};
#endif // TASKMANAGER_H