summaryrefslogtreecommitdiffstats
path: root/app/taskmanager.h
diff options
context:
space:
mode:
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