PrismLauncher/launcher/minecraft/services/SkinUpload.h

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

35 lines
750 B
C
Raw Permalink Normal View History

2016-05-12 21:51:25 +01:00
#pragma once
#include <QFile>
#include <QtNetwork/QtNetwork>
#include <memory>
#include "tasks/Task.h"
using SkinUploadPtr = shared_qobject_ptr<class SkinUpload>;
2016-05-12 21:51:25 +01:00
class SkinUpload : public Task {
Q_OBJECT
public:
enum Model { STEVE, ALEX };
2016-05-12 21:51:25 +01:00
// 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:
2016-05-12 21:51:25 +01:00
Model m_model;
QByteArray m_skin;
QString m_token;
2021-11-23 00:25:24 +00:00
shared_qobject_ptr<QNetworkReply> m_reply;
protected:
2016-05-12 21:51:25 +01:00
virtual void executeTask();
public slots:
2016-05-12 21:51:25 +01:00
void downloadError(QNetworkReply::NetworkError);
void sslErrors(const QList<QSslError>& errors);
2016-05-12 21:51:25 +01:00
void downloadFinished();
};