MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / EnsureMetadataTask

Method EnsureMetadataTask

launcher/modplatform/EnsureMetadataTask.cpp:23–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21static FlameAPI flame_api;
22
23EnsureMetadataTask::EnsureMetadataTask(Mod* mod, QDir dir, ModPlatform::Provider prov)
24 : Task(nullptr), m_index_dir(dir), m_provider(prov), m_hashing_task(nullptr), m_current_task(nullptr)
25{
26 auto hash_task = createNewHash(mod);
27 if (!hash_task)
28 return;
29 connect(hash_task.get(), &Task::succeeded, [this, hash_task, mod] { m_mods.insert(hash_task->getResult(), mod); });
30 connect(hash_task.get(), &Task::failed, [this, hash_task, mod] { emitFail(mod, "", RemoveFromList::No); });
31 hash_task->start();
32}
33
34EnsureMetadataTask::EnsureMetadataTask(QList<Mod*>& mods, QDir dir, ModPlatform::Provider prov)
35 : Task(nullptr), m_index_dir(dir), m_provider(prov), m_current_task(nullptr)

Callers

nothing calls this directly

Calls 5

insertMethod · 0.80
addTaskMethod · 0.80
getMethod · 0.45
getResultMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected