sneedmc/launcher/net/Upload.h
timoreo22 699ad316f0
Rework curseforge download (#611)
* Use the bulk endpoint on mod resolution for faster download
* Search on modrinth for api blocked mods
* Display a dialog for manually downloading blocked mods
2022-05-28 21:53:12 +02:00

32 lines
743 B
C++

#pragma once
#include "NetAction.h"
#include "Sink.h"
namespace Net {
class Upload : public NetAction {
Q_OBJECT
public:
static Upload::Ptr makeByteArray(QUrl url, QByteArray *output, QByteArray m_post_data);
protected slots:
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal) override;
void downloadError(QNetworkReply::NetworkError error) override;
void sslErrors(const QList<QSslError> & errors);
void downloadFinished() override;
void downloadReadyRead() override;
public slots:
void executeTask() override;
private:
std::unique_ptr<Sink> m_sink;
QByteArray m_post_data;
bool handleRedirect();
};
} // Net