diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-28 18:29:04 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-28 18:29:04 +0300 |
commit | 8f9bd9617fc9f555b4814993ecbe70802fa5817c (patch) | |
tree | b56cc29a97aeab37b4c9ef8cdf4e7ebe030fdd6f /launcher/modplatform/modrinth/ModrinthPackExportTask.cpp | |
parent | 1ff8136f98cf3bb2983043fcaaf3e65366b4e6d4 (diff) | |
parent | faec21d572549793293bf41127e384811f8a66dc (diff) | |
download | PrismLauncher-8f9bd9617fc9f555b4814993ecbe70802fa5817c.tar.gz PrismLauncher-8f9bd9617fc9f555b4814993ecbe70802fa5817c.tar.bz2 PrismLauncher-8f9bd9617fc9f555b4814993ecbe70802fa5817c.zip |
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into scale_cat
Diffstat (limited to 'launcher/modplatform/modrinth/ModrinthPackExportTask.cpp')
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthPackExportTask.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp b/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp index bff9bf42..4cd88aa6 100644 --- a/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp +++ b/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp @@ -134,8 +134,8 @@ void ModrinthPackExportTask::collectHashes() QCryptographicHash sha1(QCryptographicHash::Algorithm::Sha1); sha1.addData(data); - ResolvedFile file{ sha1.result().toHex(), sha512.result().toHex(), url.toString(), openFile.size() }; - resolvedFiles[relative] = file; + ResolvedFile resolvedFile{ sha1.result().toHex(), sha512.result().toHex(), url.toEncoded(), openFile.size() }; + resolvedFiles[relative] = resolvedFile; // nice! we've managed to resolve based on local metadata! // no need to enqueue it @@ -157,7 +157,7 @@ void ModrinthPackExportTask::makeApiRequest() if (pendingHashes.isEmpty()) buildZip(); else { - QByteArray* response = new QByteArray; + auto response = std::make_shared<QByteArray>(); task = api.currentVersions(pendingHashes.values(), "sha512", response); connect(task.get(), &NetJob::succeeded, [this, response]() { parseApiResponse(response); }); connect(task.get(), &NetJob::failed, this, &ModrinthPackExportTask::emitFailed); @@ -165,7 +165,7 @@ void ModrinthPackExportTask::makeApiRequest() } } -void ModrinthPackExportTask::parseApiResponse(const QByteArray* response) +void ModrinthPackExportTask::parseApiResponse(const std::shared_ptr<QByteArray> response) { task = nullptr; |