mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-12-27 12:15:26 +00:00
3c46d8a412
This makes the account system much more modular and makes it treat errors as something recoverable, unless they come directly from the MSA refresh token becoming invalid.
38 lines
709 B
C++
38 lines
709 B
C++
#pragma once
|
|
|
|
#include <QFile>
|
|
#include <QtNetwork/QtNetwork>
|
|
#include <memory>
|
|
#include "tasks/Task.h"
|
|
|
|
typedef shared_qobject_ptr<class SkinUpload> SkinUploadPtr;
|
|
|
|
class SkinUpload : public Task
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
enum Model
|
|
{
|
|
STEVE,
|
|
ALEX
|
|
};
|
|
|
|
// Note this class takes ownership of the file.
|
|
SkinUpload(QObject *parent, QString token, QByteArray skin, Model model = STEVE);
|
|
virtual ~SkinUpload() {}
|
|
|
|
private:
|
|
Model m_model;
|
|
QByteArray m_skin;
|
|
QString m_token;
|
|
shared_qobject_ptr<QNetworkReply> m_reply;
|
|
protected:
|
|
virtual void executeTask();
|
|
|
|
public slots:
|
|
|
|
void downloadError(QNetworkReply::NetworkError);
|
|
|
|
void downloadFinished();
|
|
};
|