2017-04-20 04:22:04 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "tasks/Task.h"
|
|
|
|
#include "net/NetJob.h"
|
|
|
|
#include "PackManifest.h"
|
|
|
|
|
2017-04-22 17:51:04 +01:00
|
|
|
namespace Flame
|
2017-04-20 04:22:04 +01:00
|
|
|
{
|
2021-07-25 18:11:59 +01:00
|
|
|
class FileResolvingTask : public Task
|
2017-04-20 04:22:04 +01:00
|
|
|
{
|
2018-07-15 13:51:05 +01:00
|
|
|
Q_OBJECT
|
2017-04-20 04:22:04 +01:00
|
|
|
public:
|
2022-05-28 20:53:12 +01:00
|
|
|
explicit FileResolvingTask(const shared_qobject_ptr<QNetworkAccessManager>& network, Flame::Manifest &toProcess);
|
2018-07-15 13:51:05 +01:00
|
|
|
virtual ~FileResolvingTask() {};
|
2018-06-28 20:34:56 +01:00
|
|
|
|
2018-07-15 13:51:05 +01:00
|
|
|
const Flame::Manifest &getResults() const
|
|
|
|
{
|
|
|
|
return m_toProcess;
|
|
|
|
}
|
2017-04-20 04:22:04 +01:00
|
|
|
|
|
|
|
protected:
|
2018-07-15 13:51:05 +01:00
|
|
|
virtual void executeTask() override;
|
2017-04-20 04:22:04 +01:00
|
|
|
|
|
|
|
protected slots:
|
2018-07-15 13:51:05 +01:00
|
|
|
void netJobFinished();
|
2017-04-20 04:22:04 +01:00
|
|
|
|
|
|
|
private: /* data */
|
2021-11-21 22:21:12 +00:00
|
|
|
shared_qobject_ptr<QNetworkAccessManager> m_network;
|
2018-07-15 13:51:05 +01:00
|
|
|
Flame::Manifest m_toProcess;
|
2022-05-28 20:53:12 +01:00
|
|
|
std::shared_ptr<QByteArray> result;
|
2021-11-21 22:21:12 +00:00
|
|
|
NetJob::Ptr m_dljob;
|
2022-05-28 20:53:12 +01:00
|
|
|
|
|
|
|
void modrinthCheckFinished();
|
|
|
|
|
|
|
|
QMap<File *, QByteArray *> blockedProjects;
|
2017-04-20 04:22:04 +01:00
|
|
|
};
|
|
|
|
}
|