PrismLauncher/launcher/screenshots/ImgurUpload.h
flow 8c8eabf7ac
refactor: organize a little more the code in launcher/net/
This also reduces some code duplication by using some Task logic in
NetAction.
2022-05-12 18:11:49 -03:00

30 lines
684 B
C++

#pragma once
#include "QObjectPtr.h"
#include "net/NetAction.h"
#include "Screenshot.h"
class ImgurUpload : public NetAction {
public:
using Ptr = shared_qobject_ptr<ImgurUpload>;
explicit ImgurUpload(ScreenShot::Ptr shot);
static Ptr make(ScreenShot::Ptr shot) {
return Ptr(new ImgurUpload(shot));
}
protected
slots:
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal) override;
void downloadError(QNetworkReply::NetworkError error) override;
void downloadFinished() override;
void downloadReadyRead() override {}
public
slots:
void executeTask() override;
private:
ScreenShot::Ptr m_shot;
bool finished = true;
};