mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
2a77f6f012
Signed-off-by: Paulchen-Panther <Paulchen--Panter@gmx.net>
46 lines
800 B
C++
46 lines
800 B
C++
// qt includes
|
|
#include <QNetworkAccessManager>
|
|
#include <QNetworkRequest>
|
|
#include <QNetworkReply>
|
|
#include <QUrl>
|
|
#include <QUrlQuery>
|
|
#include <QTimer>
|
|
|
|
// hyperion includes
|
|
#include <utils/Logger.h>
|
|
#include <hyperion/Hyperion.h>
|
|
|
|
class Stats : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
Stats();
|
|
static Stats* getInstance() { return instance; };
|
|
static Stats* instance;
|
|
|
|
void handleDataUpdate(const QJsonObject& config);
|
|
|
|
private:
|
|
friend class HyperionDaemon;
|
|
Stats(const QJsonObject& config);
|
|
~Stats();
|
|
|
|
private:
|
|
Logger* _log;
|
|
Hyperion* _hyperion;
|
|
QString _hash = "";
|
|
QByteArray _ba;
|
|
QNetworkRequest _req;
|
|
QNetworkAccessManager _mgr;
|
|
|
|
bool trigger(bool set = false);
|
|
|
|
private slots:
|
|
void initialExec();
|
|
void sendHTTP();
|
|
void sendHTTPp();
|
|
void resolveReply(QNetworkReply *reply);
|
|
|
|
};
|