Simplify implementation by removing some unused code

Only applies to cauldron loader which doesn't exist on Modrinth or
CurseForge, and doesn't even make sense for shaders.

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad
2025-12-09 11:42:17 +00:00
parent 2477c4f021
commit 66c8afe4d3
8 changed files with 19 additions and 57 deletions

View File

@@ -185,9 +185,8 @@ void ResourceDownloadDialog::confirm()
});
for (auto& task : selected) {
auto extraInfo = dependencyExtraInfo.value(task->getPack()->addonId.toString());
confirm_dialog->appendResource({ task->getName(), task->getFilename(), task->getCustomPath(),
ModPlatform::ProviderCapabilities::name(task->getProvider()), extraInfo.required_by,
ModPlatform::indexedVersionTypeToString(task->getVersion().version_type),
confirm_dialog->appendResource({ task->getName(), task->getFilename(), ModPlatform::ProviderCapabilities::name(task->getProvider()),
extraInfo.required_by, ModPlatform::indexedVersionTypeToString(task->getVersion().version_type),
!extraInfo.maybe_installed });
}

View File

@@ -68,17 +68,6 @@ void ReviewMessageBox::appendResource(ResourceInformation&& info)
filenameItem->setText(0, tr("Filename: %1").arg(info.filename));
filenameItem->setData(0, Qt::UserRole, info.filename);
if (!info.custom_file_path.isEmpty()) {
auto customPathItem = new QTreeWidgetItem(itemTop);
customPathItem->setText(0, tr("This download will be placed in: %1").arg(info.custom_file_path));
customPathItem->setData(0, Qt::UserRole, info.custom_file_path);
itemTop->setIcon(1, QIcon(QIcon::fromTheme("status-yellow")));
itemTop->setToolTip(
1,
tr("This file will be downloaded to a folder location different from the default, possibly due to its loader requiring it."));
}
auto providerItem = new QTreeWidgetItem(itemTop);
providerItem->setText(0, tr("Provider: %1").arg(info.provider));
providerItem->setData(0, Qt::UserRole, info.provider);
@@ -137,4 +126,4 @@ void ReviewMessageBox::on_toggleDepsButton_clicked()
auto state = m_deps_checked ? Qt::Checked : Qt::Unchecked;
for (auto dep : m_deps)
dep->setCheckState(0, state);
};
};

View File

@@ -16,7 +16,6 @@ class ReviewMessageBox : public QDialog {
using ResourceInformation = struct res_info {
QString name;
QString filename;
QString custom_file_path{};
QString provider;
QStringList required_by;
QString version_type;

View File

@@ -472,11 +472,10 @@ void ResourceModel::infoRequestSucceeded(ModPlatform::IndexedPack::Ptr pack, con
void ResourceModel::addPack(ModPlatform::IndexedPack::Ptr pack,
ModPlatform::IndexedVersion& version,
const std::shared_ptr<ResourceFolderModel> packs,
bool is_indexed,
QString custom_target_folder)
bool is_indexed)
{
version.is_currently_selected = true;
m_selected.append(makeShared<ResourceDownloadTask>(pack, version, packs, is_indexed, custom_target_folder));
m_selected.append(makeShared<ResourceDownloadTask>(pack, version, packs, is_indexed));
}
void ResourceModel::removePack(const QString& rem)

View File

@@ -94,8 +94,7 @@ class ResourceModel : public QAbstractListModel {
void addPack(ModPlatform::IndexedPack::Ptr pack,
ModPlatform::IndexedVersion& version,
std::shared_ptr<ResourceFolderModel> packs,
bool is_indexed = false,
QString custom_target_folder = {});
bool is_indexed = false);
void removePack(const QString& rem);
QList<DownloadTaskPtr> selectedPacks() { return m_selected; }

View File

@@ -47,10 +47,7 @@ void ShaderPackResourcePage::addResourceToPage(ModPlatform::IndexedPack::Ptr pac
const std::shared_ptr<ResourceFolderModel> base_model)
{
bool is_indexed = !APPLICATION->settings()->get("ModMetadataDisabled").toBool();
QString custom_target_folder;
if (version.loaders & ModPlatform::Cauldron)
custom_target_folder = QStringLiteral("resourcepacks");
m_model->addPack(pack, version, base_model, is_indexed, custom_target_folder);
m_model->addPack(pack, version, base_model, is_indexed);
}
} // namespace ResourceDownload