diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2023-08-28 22:18:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-28 22:18:58 +0200 |
commit | b83fdbd1b752acdf555fb90d397ff61ddb896f2c (patch) | |
tree | c9e31a7cf78fc7b6822c4ac71fee1200ac1b90db | |
parent | fbf68331249b1cc3bf63dd13b5acab9a229acf5a (diff) | |
parent | 0e67686295e25a3dda587e4955837e6201ae23e8 (diff) | |
download | PrismLauncher-b83fdbd1b752acdf555fb90d397ff61ddb896f2c.tar.gz PrismLauncher-b83fdbd1b752acdf555fb90d397ff61ddb896f2c.tar.bz2 PrismLauncher-b83fdbd1b752acdf555fb90d397ff61ddb896f2c.zip |
Merge pull request #1575 from TheKodeToad/more-pack-export-fixes
-rw-r--r-- | launcher/FileIgnoreProxy.cpp | 5 | ||||
-rw-r--r-- | launcher/ui/dialogs/ExportPackDialog.cpp | 10 |
2 files changed, 6 insertions, 9 deletions
diff --git a/launcher/FileIgnoreProxy.cpp b/launcher/FileIgnoreProxy.cpp index 4c8c64c7..df06c3c7 100644 --- a/launcher/FileIgnoreProxy.cpp +++ b/launcher/FileIgnoreProxy.cpp @@ -267,10 +267,7 @@ bool FileIgnoreProxy::filterAcceptsRow(int sourceRow, const QModelIndex& sourceP bool FileIgnoreProxy::ignoreFile(QFileInfo fileInfo) const { - auto fileName = fileInfo.fileName(); - auto path = relPath(fileInfo.absoluteFilePath()); - return std::any_of(m_ignoreFiles.cbegin(), m_ignoreFiles.cend(), [fileName](auto iFileName) { return fileName == iFileName; }) || - m_ignoreFilePaths.covers(path); + return m_ignoreFiles.contains(fileInfo.fileName()) || m_ignoreFilePaths.covers(relPath(fileInfo.absoluteFilePath())); } bool FileIgnoreProxy::filterFile(const QString& fileName) const diff --git a/launcher/ui/dialogs/ExportPackDialog.cpp b/launcher/ui/dialogs/ExportPackDialog.cpp index 0a97ee13..5af24b1b 100644 --- a/launcher/ui/dialogs/ExportPackDialog.cpp +++ b/launcher/ui/dialogs/ExportPackDialog.cpp @@ -81,10 +81,9 @@ ExportPackDialog::ExportPackDialog(InstancePtr instance, QWidget* parent, ModPla MinecraftInstance* mcInstance = dynamic_cast<MinecraftInstance*>(instance.get()); if (mcInstance) { - mcInstance->loaderModList()->update(); const QDir index = mcInstance->loaderModList()->indexDir(); if (index.exists()) - proxy->blockedPaths().insert(root.relativeFilePath(index.absolutePath())); + proxy->ignoreFilesWithPath().insert(root.relativeFilePath(index.absolutePath())); } ui->files->setModel(proxy); @@ -120,18 +119,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, |