sneedmc/launcher/net/PasteUpload.h

32 lines
601 B
C
Raw Normal View History

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