Trial97 609eaa67ab
refactored skin apis
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
2023-09-01 21:23:51 +03:00

26 lines
621 B
C++

#pragma once
#include "net/NetRequest.h"
class SkinUpload : public Net::NetRequest {
Q_OBJECT
public:
using Ptr = shared_qobject_ptr<SkinUpload>;
enum Model { STEVE, ALEX };
// Note this class takes ownership of the file.
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;
private:
Model m_model;
QByteArray m_skin;
QString m_token;
};