2017-04-20 08:52:04 +05:30
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "PackManifest.h"
|
2023-05-21 14:16:28 +05:30
|
|
|
#include "net/NetJob.h"
|
|
|
|
#include "tasks/Task.h"
|
2017-04-20 08:52:04 +05:30
|
|
|
|
2023-05-21 14:16:28 +05:30
|
|
|
namespace Flame {
|
|
|
|
class FileResolvingTask : public Task {
|
2018-07-15 18:21:05 +05:30
|
|
|
Q_OBJECT
|
2023-05-21 14:16:28 +05:30
|
|
|
public:
|
|
|
|
explicit FileResolvingTask(const shared_qobject_ptr<QNetworkAccessManager>& network, Flame::Manifest& toProcess);
|
|
|
|
virtual ~FileResolvingTask(){};
|
2018-06-29 01:04:56 +05:30
|
|
|
|
2022-07-26 01:07:10 +05:30
|
|
|
bool canAbort() const override { return true; }
|
|
|
|
bool abort() override;
|
|
|
|
|
2023-05-21 14:16:28 +05:30
|
|
|
const Flame::Manifest& getResults() const { return m_toProcess; }
|
2017-04-20 08:52:04 +05:30
|
|
|
|
2023-05-21 14:16:28 +05:30
|
|
|
protected:
|
2018-07-15 18:21:05 +05:30
|
|
|
virtual void executeTask() override;
|
2017-04-20 08:52:04 +05:30
|
|
|
|
2023-05-21 14:16:28 +05:30
|
|
|
protected slots:
|
2018-07-15 18:21:05 +05:30
|
|
|
void netJobFinished();
|
2017-04-20 08:52:04 +05:30
|
|
|
|
2023-05-21 14:16:28 +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;
|
2023-05-21 14:16:28 +05:30
|
|
|
std::shared_ptr<QByteArray> result;
|
2021-11-22 03:51:12 +05:30
|
|
|
NetJob::Ptr m_dljob;
|
2023-05-21 14:16:28 +05:30
|
|
|
NetJob::Ptr m_checkJob;
|
|
|
|
NetJob::Ptr m_slugJob;
|
2022-05-29 01:23:12 +05:30
|
|
|
|
|
|
|
void modrinthCheckFinished();
|
|
|
|
|
2023-05-21 14:16:28 +05:30
|
|
|
QMap<File*, std::shared_ptr<QByteArray>> blockedProjects;
|
2017-04-20 08:52:04 +05:30
|
|
|
};
|
2023-05-21 14:16:28 +05:30
|
|
|
} // namespace Flame
|