diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-06-25 12:36:27 -0700 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-06-25 12:43:48 -0700 |
commit | df4fd7df7f98589c5dba85e4b5cdf0179a77faf5 (patch) | |
tree | b382b0375a12d91305849f5dad41f4e0b04de8df /launcher/modplatform/modrinth/ModrinthPackExportTask.cpp | |
parent | c8ff812ab89044890d88779e33f3c6f86c4b8f74 (diff) | |
parent | 1bd778d0ae27b3e87b800f773d5bc35708060c19 (diff) | |
download | PrismLauncher-df4fd7df7f98589c5dba85e4b5cdf0179a77faf5.tar.gz PrismLauncher-df4fd7df7f98589c5dba85e4b5cdf0179a77faf5.tar.bz2 PrismLauncher-df4fd7df7f98589c5dba85e4b5cdf0179a77faf5.zip |
Merge remote-tracking branch 'upstream/develop' into refactor/net-split-headers-to-proxy-class
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; |