aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheKodeToad <TheKodeToad@proton.me>2023-03-02 17:36:28 +0000
committerTheKodeToad <TheKodeToad@proton.me>2023-03-02 17:36:28 +0000
commit9ec32b2561eac4ae50db88467d9afae57dd78614 (patch)
treea278d0b30a5b62ec226e637c1f709b0ec44b9113
parenta5dd6b6cd7050b4861a50a417d939c6a49d5cc33 (diff)
downloadPrismLauncher-9ec32b2561eac4ae50db88467d9afae57dd78614.tar.gz
PrismLauncher-9ec32b2561eac4ae50db88467d9afae57dd78614.tar.bz2
PrismLauncher-9ec32b2561eac4ae50db88467d9afae57dd78614.zip
Fix QuaZipFile usage
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
-rw-r--r--launcher/ui/dialogs/ExportMrPackDialog.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/launcher/ui/dialogs/ExportMrPackDialog.cpp b/launcher/ui/dialogs/ExportMrPackDialog.cpp
index 9015407d..96c7a201 100644
--- a/launcher/ui/dialogs/ExportMrPackDialog.cpp
+++ b/launcher/ui/dialogs/ExportMrPackDialog.cpp
@@ -86,15 +86,15 @@ void ExportMrPackDialog::runExport()
return;
}
- QuaZipFile indexFile(&zip);
- indexFile.setFileName("modrinth.index.json");
- if (!indexFile.open(QuaZipFile::NewOnly)) {
- QFile::remove(output);
- QMessageBox::warning(this, tr("Unable to export modpack"), tr("Could not create index"));
- return;
+ {
+ QuaZipFile indexFile(&zip);
+ if (!indexFile.open(QIODevice::WriteOnly, QuaZipNewInfo("modrinth.index.json"))) {
+ QFile::remove(output);
+ QMessageBox::warning(this, tr("Unable to export modpack"), tr("Could not create index"));
+ return;
+ }
+ indexFile.write(generateIndex());
}
- indexFile.write(generateIndex());
- indexFile.close();
// should exist
QDir dotMinecraft(instance->gameRoot());