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