PrismLauncher/launcher/minecraft/services/SkinUpload.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
761 B
C
Raw Normal View History

2016-05-12 21:51:25 +01:00
#pragma once
#include <QFile>
#include <QtNetwork/QtNetwork>
#include <memory>
#include "tasks/Task.h"
2021-11-23 00:25:24 +00:00
typedef shared_qobject_ptr<class SkinUpload> SkinUploadPtr;
2016-05-12 21:51:25 +01:00
class SkinUpload : public Task
2016-05-12 21:51:25 +01:00
{
Q_OBJECT
2016-05-12 21:51:25 +01:00
public:
enum Model
{
STEVE,
ALEX
};
// Note this class takes ownership of the file.
SkinUpload(QObject *parent, QString token, QByteArray skin, Model model = STEVE);
2016-05-12 21:51:25 +01:00
virtual ~SkinUpload() {}
private:
Model m_model;
QByteArray m_skin;
QString m_token;
2021-11-23 00:25:24 +00:00
shared_qobject_ptr<QNetworkReply> m_reply;
2016-05-12 21:51:25 +01:00
protected:
virtual void executeTask();
public slots:
void downloadError(QNetworkReply::NetworkError);
void sslErrors(const QList<QSslError>& errors);
2016-05-12 21:51:25 +01:00
void downloadFinished();
};