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