2020-11-26 22:26:15 +01:00
|
|
|
#ifndef DOWNLOADSTATSTELEMETRY_H
|
|
|
|
#define DOWNLOADSTATSTELEMETRY_H
|
|
|
|
|
|
|
|
/*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
* Copyright (C) 2020 Raspberry Pi (Trading) Limited
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QThread>
|
|
|
|
#include <curl/curl.h>
|
|
|
|
|
|
|
|
class DownloadStatsTelemetry : public QThread
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2022-02-03 11:41:23 +01:00
|
|
|
explicit DownloadStatsTelemetry(const QByteArray &url, const QByteArray &parentcategory, const QByteArray &osname, bool embedded, const QString &imagerLang, QObject *parent = nullptr);
|
2020-11-26 22:26:15 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
CURL *_c;
|
2020-12-08 13:36:02 +01:00
|
|
|
QByteArray _url, _useragent, _postfields;
|
2020-11-26 22:26:15 +01:00
|
|
|
virtual void run();
|
|
|
|
static size_t _curl_write_callback(char *ptr, size_t size, size_t nmemb, void *userdata);
|
|
|
|
static size_t _curl_header_callback( void *ptr, size_t size, size_t nmemb, void *userdata);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DOWNLOADSTATSTELEMETRY_H
|