pollymc/api/logic/minecraft/SkinUpload.h
Petr Mrázek e5b4b5d295 GH-1927 Add more specific task status logging
* Tasks are now described by class name and object name (or memory address).
* Tasks starts are logged.
* Aborted tasks are now treated just as the other cases.
2017-07-07 19:46:56 +02:00

41 lines
763 B
C++

#pragma once
#include <QFile>
#include <QtNetwork/QtNetwork>
#include <memory>
#include <minecraft/auth/AuthSession.h>
#include "tasks/Task.h"
#include "multimc_logic_export.h"
typedef std::shared_ptr<class SkinUpload> SkinUploadPtr;
class MULTIMC_LOGIC_EXPORT SkinUpload : public Task
{
Q_OBJECT
public:
enum Model
{
STEVE,
ALEX
};
// Note this class takes ownership of the file.
SkinUpload(QObject *parent, AuthSessionPtr session, QByteArray skin, Model model = STEVE);
virtual ~SkinUpload() {}
private:
Model m_model;
QByteArray m_skin;
AuthSessionPtr m_session;
std::shared_ptr<QNetworkReply> m_reply;
protected:
virtual void executeTask();
public slots:
void downloadError(QNetworkReply::NetworkError);
void downloadFinished();
};