diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-25 12:26:54 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-25 12:26:54 +0300 |
commit | ef0752972ae64002a02e66e430165f3e93c09c53 (patch) | |
tree | bb4337a52c9fe3b0c063cb3b3af5e411826a8d90 /launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp | |
parent | 3c9c39cb890252f94d0c50caa00de5439881d7f6 (diff) | |
parent | bcf45c74a1b0b3389c05927637bf8aa95b8e43cf (diff) | |
download | PrismLauncher-ef0752972ae64002a02e66e430165f3e93c09c53.tar.gz PrismLauncher-ef0752972ae64002a02e66e430165f3e93c09c53.tar.bz2 PrismLauncher-ef0752972ae64002a02e66e430165f3e93c09c53.zip |
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into export
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; |