2013-12-06 21:24:55 +00:00
|
|
|
#pragma once
|
2015-02-09 00:51:14 +00:00
|
|
|
#include "tasks/Task.h"
|
2013-12-06 21:24:55 +00:00
|
|
|
#include <QNetworkReply>
|
2015-10-01 23:12:53 +01:00
|
|
|
#include <QBuffer>
|
2013-12-06 21:24:55 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2021-07-25 18:11:59 +01:00
|
|
|
class PasteUpload : public Task
|
2013-12-06 21:24:55 +00:00
|
|
|
{
|
2018-07-15 13:51:05 +01:00
|
|
|
Q_OBJECT
|
2013-12-06 21:24:55 +00:00
|
|
|
public:
|
2022-01-19 07:44:29 +00:00
|
|
|
PasteUpload(QWidget *window, QString text, QString url);
|
2018-07-15 13:51:05 +01:00
|
|
|
virtual ~PasteUpload();
|
2018-06-28 20:34:56 +01:00
|
|
|
|
2018-07-15 13:51:05 +01:00
|
|
|
QString pasteLink()
|
|
|
|
{
|
|
|
|
return m_pasteLink;
|
|
|
|
}
|
2013-12-06 21:24:55 +00:00
|
|
|
protected:
|
2018-07-15 13:51:05 +01:00
|
|
|
virtual void executeTask();
|
2013-12-06 21:24:55 +00:00
|
|
|
|
|
|
|
private:
|
2018-07-15 13:51:05 +01:00
|
|
|
QWidget *m_window;
|
|
|
|
QString m_pasteLink;
|
2022-01-19 07:44:29 +00:00
|
|
|
QString m_uploadUrl;
|
|
|
|
QByteArray m_text;
|
2018-07-15 13:51:05 +01:00
|
|
|
std::shared_ptr<QNetworkReply> m_reply;
|
2013-12-06 21:24:55 +00:00
|
|
|
public
|
|
|
|
slots:
|
2018-07-15 13:51:05 +01:00
|
|
|
void downloadError(QNetworkReply::NetworkError);
|
|
|
|
void downloadFinished();
|
2013-12-06 21:24:55 +00:00
|
|
|
};
|