pollymc/launcher/minecraft/services/SkinUpload.h
Rachel Powers 12f0d51c0c Fix: signal/slot macro -> func pointer & network fixes
- convert qt connect calls to use function pointers instead of the signal/slot macros wherever practical (UI classes were mostly left alone, target was tasks and processes)
- give signals an explicit receivers to use the static method over the instance method wherever practical
- ensure networks tasks are using the `errorOccured` signal added in Qt5.15 over the deprecated `error` signal
- ensure all networks tasks have an sslErrors signal connected
- add seemingly missing `MinecraftAccount::authSucceeded` connection for `MSAInteractive` login flow

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2023-04-17 18:23:18 -07:00

39 lines
761 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 sslErrors(const QList<QSslError>& errors);
void downloadFinished();
};