diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-06-23 09:13:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-23 09:13:52 -0700 |
commit | 046d510134a0061c0a1fa89fda80355c9e2f11ff (patch) | |
tree | fcbceeb50d29cde8f5378246aceebea33b60bcc1 /launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp | |
parent | 8df5ab8aa7ec32ee3c44e2b57dc9c9f04e093d9d (diff) | |
parent | 85bbab0e9284e35b0fec26405537c9160496974f (diff) | |
download | PrismLauncher-046d510134a0061c0a1fa89fda80355c9e2f11ff.tar.gz PrismLauncher-046d510134a0061c0a1fa89fda80355c9e2f11ff.tar.bz2 PrismLauncher-046d510134a0061c0a1fa89fda80355c9e2f11ff.zip |
Merge pull request #1200 from Trial97/net_job_crash
Made ByteSynkArray to use shared_ptr
Diffstat (limited to 'launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp')
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp b/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp index 4fe91ce7..a7c22832 100644 --- a/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp +++ b/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp @@ -53,12 +53,11 @@ void ModrinthCheckUpdate::executeTask() // (though it will rarely happen, if at all) if (mod->metadata()->hash_format != best_hash_type) { auto hash_task = Hashing::createModrinthHasher(mod->fileinfo().absoluteFilePath()); - connect(hash_task.get(), &Task::succeeded, [&] { - QString hash(hash_task->getResult()); + connect(hash_task.get(), &Hashing::Hasher::resultsReady, [&hashes, &mappings, mod](QString hash) { hashes.append(hash); mappings.insert(hash, mod); }); - connect(hash_task.get(), &Task::failed, [this, hash_task] { failed("Failed to generate hash"); }); + connect(hash_task.get(), &Task::failed, [this] { failed("Failed to generate hash"); }); hashing_task.addTask(hash_task); } else { hashes.append(hash); @@ -71,7 +70,7 @@ void ModrinthCheckUpdate::executeTask() hashing_task.start(); loop.exec(); - auto* response = new QByteArray(); + auto response = std::make_shared<QByteArray>(); auto job = api.latestVersions(hashes, best_hash_type, m_game_versions, m_loaders, response); QEventLoop lock; |