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

Method executeTask

launcher/modplatform/helpers/HashUtils.cpp:38–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38void ModrinthHasher::executeTask()
39{
40 QFile file(m_path);
41
42 try {
43 file.open(QFile::ReadOnly);
44 } catch (FS::FileSystemException& e) {
45 qCritical() << QString("Failed to open JAR file in %1").arg(m_path);
46 qCritical() << QString("Reason: ") << e.cause();
47
48 emitFailed("Failed to open file for hashing.");
49 return;
50 }
51
52 auto hash_type = ProviderCaps.hashType(ModPlatform::Provider::MODRINTH).first();
53 m_hash = ProviderCaps.hash(ModPlatform::Provider::MODRINTH, &file, hash_type);
54
55 file.close();
56
57 if (m_hash.isEmpty()) {
58 emitFailed("Empty hash!");
59 } else {
60 emitSucceeded();
61 }
62}
63
64void FlameHasher::executeTask()
65{

Callers

nothing calls this directly

Calls 8

QStringClass · 0.85
MurmurHash2Function · 0.85
openMethod · 0.80
causeMethod · 0.80
firstMethod · 0.80
hashTypeMethod · 0.80
isEmptyMethod · 0.80
hashMethod · 0.45

Tested by

no test coverage detected