2017-11-11 00:38:31 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "tasks/Task.h"
|
|
|
|
#include "net/Mode.h"
|
|
|
|
|
|
|
|
#include <memory>
|
2020-06-27 11:02:31 +01:00
|
|
|
class PackProfile;
|
2017-11-11 00:38:31 +00:00
|
|
|
struct ComponentUpdateTaskData;
|
|
|
|
|
|
|
|
class ComponentUpdateTask : public Task
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
enum class Mode
|
|
|
|
{
|
|
|
|
Launch,
|
|
|
|
Resolution
|
|
|
|
};
|
|
|
|
|
|
|
|
public:
|
2020-06-27 11:02:31 +01:00
|
|
|
explicit ComponentUpdateTask(Mode mode, Net::Mode netmode, PackProfile * list, QObject *parent = 0);
|
2017-11-11 00:38:31 +00:00
|
|
|
virtual ~ComponentUpdateTask();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void executeTask();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void loadComponents();
|
|
|
|
void resolveDependencies(bool checkOnly);
|
|
|
|
|
|
|
|
void remoteLoadSucceeded(size_t index);
|
|
|
|
void remoteLoadFailed(size_t index, const QString &msg);
|
|
|
|
void checkIfAllFinished();
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::unique_ptr<ComponentUpdateTaskData> d;
|
|
|
|
};
|