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