2016-05-12 16:51:25 -04:00
|
|
|
#pragma once
|
|
|
|
|
2023-09-01 21:23:51 +03:00
|
|
|
#include "net/NetRequest.h"
|
2016-05-12 16:51:25 -04:00
|
|
|
|
2023-09-01 21:23:51 +03:00
|
|
|
class SkinUpload : public Net::NetRequest {
|
2017-07-07 19:46:56 +02:00
|
|
|
Q_OBJECT
|
2023-08-02 18:35:35 +02:00
|
|
|
public:
|
2023-09-01 21:23:51 +03:00
|
|
|
using Ptr = shared_qobject_ptr<SkinUpload>;
|
2023-08-02 18:35:35 +02:00
|
|
|
enum Model { STEVE, ALEX };
|
2016-05-12 16:51:25 -04:00
|
|
|
|
|
|
|
// Note this class takes ownership of the file.
|
2023-09-01 21:23:51 +03:00
|
|
|
SkinUpload(QString token, QByteArray skin, Model model = STEVE);
|
|
|
|
virtual ~SkinUpload() = default;
|
|
|
|
|
|
|
|
static SkinUpload::Ptr make(QString token, QByteArray skin, Model model = STEVE);
|
|
|
|
void init() override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual QNetworkReply* getReply(QNetworkRequest&) override;
|
2016-05-12 16:51:25 -04:00
|
|
|
|
2023-08-02 18:35:35 +02:00
|
|
|
private:
|
2016-05-12 16:51:25 -04:00
|
|
|
Model m_model;
|
|
|
|
QByteArray m_skin;
|
2021-12-04 01:18:05 +01:00
|
|
|
QString m_token;
|
2016-05-12 16:51:25 -04:00
|
|
|
};
|