mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-08 03:15:51 +00:00
add ability to upload telemetry to a server
This commit is contained in:
@ -22,6 +22,9 @@
|
||||
#include <QObject>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
#define REMOTE_TELEMETRY_URL "http://arcanis.me/telemetry"
|
||||
#define REMOTE_TELEMETRY_PORT 8080
|
||||
|
||||
|
||||
class QAbstractButton;
|
||||
class QNetworkReply;
|
||||
@ -31,16 +34,19 @@ class AWTelemetryHandler : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AWTelemetryHandler(QObject *parent = nullptr);
|
||||
explicit AWTelemetryHandler(QObject *parent = nullptr,
|
||||
const QString clientId = QString());
|
||||
virtual ~AWTelemetryHandler();
|
||||
Q_INVOKABLE QStringList get(const QString group) const;
|
||||
Q_INVOKABLE QString getLast(const QString group) const;
|
||||
Q_INVOKABLE bool put(const QString group, const QString value) const;
|
||||
Q_INVOKABLE bool rotate() const;
|
||||
Q_INVOKABLE void uploadTelemetry(const QString group, const QString value);
|
||||
|
||||
private slots:
|
||||
void telemetryReplyRecieved(QNetworkReply *reply);
|
||||
|
||||
private:
|
||||
QString getKey(const int count) const;
|
||||
void init();
|
||||
bool setConfiguration(const QString key, const QVariant value,
|
||||
const bool override) const;
|
||||
@ -48,6 +54,7 @@ private:
|
||||
QString m_genericConfig;
|
||||
QString m_localFile;
|
||||
int m_storeCount = 0;
|
||||
bool m_uploadEnabled = false;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user