pollymc/launcher/net/PasteUpload.h

32 lines
601 B
C
Raw Normal View History

#pragma once
2015-02-09 06:21:14 +05:30
#include "tasks/Task.h"
#include <QNetworkReply>
2015-10-02 03:42:53 +05:30
#include <QBuffer>
#include <memory>
class PasteUpload : public Task
{
2018-07-15 18:21:05 +05:30
Q_OBJECT
public:
PasteUpload(QWidget *window, QString text, QString url);
2018-07-15 18:21:05 +05:30
virtual ~PasteUpload();
2018-07-15 18:21:05 +05:30
QString pasteLink()
{
return m_pasteLink;
}
protected:
2018-07-15 18:21:05 +05:30
virtual void executeTask();
private:
2018-07-15 18:21:05 +05:30
QWidget *m_window;
QString m_pasteLink;
QString m_uploadUrl;
QByteArray m_text;
2018-07-15 18:21:05 +05:30
std::shared_ptr<QNetworkReply> m_reply;
public
slots:
2018-07-15 18:21:05 +05:30
void downloadError(QNetworkReply::NetworkError);
void downloadFinished();
};