diff options
author | TheKodeToad <TheKodeToad@proton.me> | 2023-08-28 17:09:40 +0100 |
---|---|---|
committer | TheKodeToad <TheKodeToad@proton.me> | 2023-08-28 17:09:40 +0100 |
commit | e98bca47493f53b324d0ac7fd9eac9386c30be23 (patch) | |
tree | 9ddb3d1810f1e1b30569cadc8f8b3c13526caed3 /launcher/ui/dialogs | |
parent | fbf68331249b1cc3bf63dd13b5acab9a229acf5a (diff) | |
download | PrismLauncher-e98bca47493f53b324d0ac7fd9eac9386c30be23.tar.gz PrismLauncher-e98bca47493f53b324d0ac7fd9eac9386c30be23.tar.bz2 PrismLauncher-e98bca47493f53b324d0ac7fd9eac9386c30be23.zip |
Fix cancelling pack save
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
Diffstat (limited to 'launcher/ui/dialogs')
-rw-r--r-- | launcher/ui/dialogs/ExportPackDialog.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/launcher/ui/dialogs/ExportPackDialog.cpp b/launcher/ui/dialogs/ExportPackDialog.cpp index 0a97ee13..b0558df7 100644 --- a/launcher/ui/dialogs/ExportPackDialog.cpp +++ b/launcher/ui/dialogs/ExportPackDialog.cpp @@ -120,18 +120,19 @@ void ExportPackDialog::done(int result) if (m_provider == ModPlatform::ResourceProvider::MODRINTH) { output = QFileDialog::getSaveFileName(this, tr("Export %1").arg(name), FS::PathCombine(QDir::homePath(), filename + ".mrpack"), "Modrinth pack (*.mrpack *.zip)", nullptr); + if (output.isEmpty()) + return; if (!(output.endsWith(".zip") || output.endsWith(".mrpack"))) output.append(".mrpack"); } else { output = QFileDialog::getSaveFileName(this, tr("Export %1").arg(name), FS::PathCombine(QDir::homePath(), filename + ".zip"), "CurseForge pack (*.zip)", nullptr); + if (output.isEmpty()) + return; if (!output.endsWith(".zip")) output.append(".zip"); } - if (output.isEmpty()) - return; - Task* task; if (m_provider == ModPlatform::ResourceProvider::MODRINTH) { task = new ModrinthPackExportTask(name, ui->version->text(), ui->summary->text(), ui->optionalFiles->isChecked(), instance, |