retro-imager/downloadstatstelemetry.h
Floris Bos 95ce718d41 Enable telemetry
- Phone back home image downloaded for image popularity research.
  Only in case image comes from our repository (NOT for custom images)
2020-12-01 15:50:58 +01:00

31 lines
782 B
C++

#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:
explicit DownloadStatsTelemetry(const QByteArray &url, const QByteArray &parentcategory, const QByteArray &osname, QObject *parent = nullptr);
protected:
CURL *_c;
QByteArray _url, _useragent;
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