diff options
author | TheKodeToad <TheKodeToad@proton.me> | 2023-04-06 19:58:09 +0100 |
---|---|---|
committer | TheKodeToad <TheKodeToad@proton.me> | 2023-04-06 19:58:09 +0100 |
commit | 012d8bb4680b54bedd9b58fb6102c768002cf0ed (patch) | |
tree | 7f97bace48bf9167743fb42fb9db4283a8fffe7f /launcher/modplatform | |
parent | d7a137ad13854d008de438786d6a97b4092bac99 (diff) | |
download | PrismLauncher-012d8bb4680b54bedd9b58fb6102c768002cf0ed.tar.gz PrismLauncher-012d8bb4680b54bedd9b58fb6102c768002cf0ed.tar.bz2 PrismLauncher-012d8bb4680b54bedd9b58fb6102c768002cf0ed.zip |
Revert concurrent syntax
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
Diffstat (limited to 'launcher/modplatform')
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthPackExportTask.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp b/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp index 772928e9..f4b2bcd3 100644 --- a/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp +++ b/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp @@ -20,14 +20,12 @@ #include <QCryptographicHash> #include <QFileInfo> -#include <QFileInfoList> #include <QMessageBox> +#include <QtConcurrentRun> #include "Json.h" #include "MMCZip.h" -#include "minecraft/MinecraftInstance.h" #include "minecraft/PackProfile.h" #include "minecraft/mod/ModFolderModel.h" -#include "modplatform/modrinth/ModrinthAPI.h" const QStringList ModrinthPackExportTask::PREFIXES({ "mods", "coremods", "resourcepacks", "texturepacks", "shaderpacks" }); @@ -190,13 +188,11 @@ void ModrinthPackExportTask::parseApiResponse(QByteArray* response) qWarning() << "Failed to parse versions response" << e.what(); } pendingHashes.clear(); - - buildZip(); } void ModrinthPackExportTask::buildZip() { - QThreadPool::globalInstance()->start([this]() { + static_cast<void>(QtConcurrent::run(QThreadPool::globalInstance(), [this]() { setStatus("Adding files..."); QuaZip zip(output); if (!zip.open(QuaZip::mdCreate)) { @@ -249,7 +245,7 @@ void ModrinthPackExportTask::buildZip() } QMetaObject::invokeMethod(this, &ModrinthPackExportTask::emitSucceeded, Qt::QueuedConnection); - }); + })); } QByteArray ModrinthPackExportTask::generateIndex() @@ -301,6 +297,7 @@ QByteArray ModrinthPackExportTask::generateIndex() QJsonObject hashes; hashes["sha1"] = value.sha1; hashes["sha512"] = value.sha512; + file["hashes"] = hashes; file["fileSize"] = value.size; |