pollymc/launcher/screenshots/ImgurAlbumCreation.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

42 lines
968 B
C++

#pragma once
#include "net/NetAction.h"
#include "Screenshot.h"
#include "QObjectPtr.h"
typedef shared_qobject_ptr<class ImgurAlbumCreation> ImgurAlbumCreationPtr;
class ImgurAlbumCreation : public NetAction
{
public:
explicit ImgurAlbumCreation(QList<ScreenShot::Ptr> screenshots);
static ImgurAlbumCreationPtr make(QList<ScreenShot::Ptr> screenshots)
{
return ImgurAlbumCreationPtr(new ImgurAlbumCreation(screenshots));
}
QString deleteHash() const
{
return m_deleteHash;
}
QString id() const
{
return m_id;
}
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:
QList<ScreenShot::Ptr> m_screenshots;
QString m_deleteHash;
QString m_id;
};