MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / executeTask

Method executeTask

launcher/modplatform/flame/FileResolvingTask.cpp:48–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void Flame::FileResolvingTask::executeTask()
49{
50 if (m_manifest.files.isEmpty()) { // no file to resolve so leave it empty and emit success immediately
51 emitSucceeded();
52 return;
53 }
54 setStatus(tr("Resolving mod IDs..."));
55 setProgress(0, 3);
56
57 QStringList fileIds;
58 for (auto file : m_manifest.files) {
59 fileIds.push_back(QString::number(file.fileId));
60 }
61 auto [task, response] = flameAPI.getFiles(fileIds);
62 m_task = task;
63
64 auto step_progress = std::make_shared<TaskStepProgress>();
65 connect(m_task.get(), &Task::succeeded, this, [this, response, step_progress]() {
66 step_progress->state = TaskStepState::Succeeded;
67 stepProgress(*step_progress);
68 netJobFinished(response);
69 });
70 connect(m_task.get(), &Task::failed, this, [this, step_progress](QString reason) {
71 step_progress->state = TaskStepState::Failed;
72 stepProgress(*step_progress);
73 emitFailed(reason);
74 });
75 connect(m_task.get(), &Task::stepProgress, this, &FileResolvingTask::propagateStepProgress);
76 connect(m_task.get(), &Task::progress, this, [this, step_progress](qint64 current, qint64 total) {
77 qDebug() << "Resolve slug progress" << current << total;
78 step_progress->update(current, total);
79 stepProgress(*step_progress);
80 });
81 connect(m_task.get(), &Task::status, this, [this, step_progress](QString status) {
82 step_progress->status = status;
83 stepProgress(*step_progress);
84 });
85
86 m_task->start();
87}
88
89ModPlatform::ResourceType getResourceType(int classId)
90{

Callers

nothing calls this directly

Calls 5

isEmptyMethod · 0.45
getFilesMethod · 0.45
getMethod · 0.45
updateMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected