From 3d55236fdf14cbe0c39b922ed7ef21e831a3688e Mon Sep 17 00:00:00 2001 From: Trial97 Date: Fri, 25 Oct 2024 01:05:58 +0300 Subject: [PATCH 1/6] add extra protection against empty download link Signed-off-by: Trial97 (cherry picked from commit 8daa1219a508ddb37070c01046c78b731a277887) --- launcher/ui/pages/modplatform/ResourcePage.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/launcher/ui/pages/modplatform/ResourcePage.cpp b/launcher/ui/pages/modplatform/ResourcePage.cpp index 817079439..68a12c479 100644 --- a/launcher/ui/pages/modplatform/ResourcePage.cpp +++ b/launcher/ui/pages/modplatform/ResourcePage.cpp @@ -39,6 +39,7 @@ #include "ResourcePage.h" #include "modplatform/ModIndex.h" +#include "ui/dialogs/CustomMessageBox.h" #include "ui_ResourcePage.h" #include @@ -324,9 +325,9 @@ void ResourcePage::onSelectionChanged(QModelIndex curr, [[maybe_unused]] QModelI updateUi(); } -void ResourcePage::onVersionSelectionChanged(int index) +void ResourcePage::onVersionSelectionChanged(int) { - m_selected_version_index = index; + m_selected_version_index = m_ui->versionSelectionBox->currentData().toInt(); updateSelectionButton(); } @@ -358,10 +359,18 @@ void ResourcePage::onResourceSelected() return; auto current_pack = getCurrentPack(); - if (!current_pack || !current_pack->versionsLoaded) + if (!current_pack || !current_pack->versionsLoaded || current_pack->versions.size() < m_selected_version_index) return; auto& version = current_pack->versions[m_selected_version_index]; + if (version.downloadUrl.isNull()) { + CustomMessageBox::selectable(this, tr("How?"), + "You managed to select a resource that doesn't have a download link. Because of this missing " + "information prism will not try to download it.", + QMessageBox::Warning) + ->show(); + return; + } if (version.is_currently_selected) removeResourceFromDialog(current_pack->name); else From 1d9c97803a51ac1a4d44fe23adf129388688dde9 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Sun, 27 Oct 2024 03:05:30 +0200 Subject: [PATCH 2/6] rename snake_case to camelCase Signed-off-by: Trial97 (cherry picked from commit 44894a29b1784cfa8a04807c17d21169230ff922) --- launcher/ui/pages/modplatform/ModPage.cpp | 2 +- .../ui/pages/modplatform/ResourcePackPage.cpp | 2 +- .../ui/pages/modplatform/ResourcePage.cpp | 52 +++++++++---------- launcher/ui/pages/modplatform/ResourcePage.h | 14 ++--- .../ui/pages/modplatform/ShaderPackPage.cpp | 2 +- .../modplatform/flame/FlameResourcePages.cpp | 2 +- .../modrinth/ModrinthResourcePages.cpp | 2 +- 7 files changed, 38 insertions(+), 38 deletions(-) diff --git a/launcher/ui/pages/modplatform/ModPage.cpp b/launcher/ui/pages/modplatform/ModPage.cpp index c9817cdf7..f0cc2df54 100644 --- a/launcher/ui/pages/modplatform/ModPage.cpp +++ b/launcher/ui/pages/modplatform/ModPage.cpp @@ -99,7 +99,7 @@ void ModPage::triggerSearch() updateSelectionButton(); static_cast(m_model)->searchWithTerm(getSearchTerm(), m_ui->sortByBox->currentData().toUInt(), changed); - m_fetch_progress.watch(m_model->activeSearchJob().get()); + m_fetchProgress.watch(m_model->activeSearchJob().get()); } QMap ModPage::urlHandlers() const diff --git a/launcher/ui/pages/modplatform/ResourcePackPage.cpp b/launcher/ui/pages/modplatform/ResourcePackPage.cpp index 849ea1111..99039476e 100644 --- a/launcher/ui/pages/modplatform/ResourcePackPage.cpp +++ b/launcher/ui/pages/modplatform/ResourcePackPage.cpp @@ -30,7 +30,7 @@ void ResourcePackResourcePage::triggerSearch() updateSelectionButton(); static_cast(m_model)->searchWithTerm(getSearchTerm(), m_ui->sortByBox->currentData().toUInt()); - m_fetch_progress.watch(m_model->activeSearchJob().get()); + m_fetchProgress.watch(m_model->activeSearchJob().get()); } QMap ResourcePackResourcePage::urlHandlers() const diff --git a/launcher/ui/pages/modplatform/ResourcePage.cpp b/launcher/ui/pages/modplatform/ResourcePage.cpp index 68a12c479..1fcc2bdd8 100644 --- a/launcher/ui/pages/modplatform/ResourcePage.cpp +++ b/launcher/ui/pages/modplatform/ResourcePage.cpp @@ -55,7 +55,7 @@ namespace ResourceDownload { ResourcePage::ResourcePage(ResourceDownloadDialog* parent, BaseInstance& base_instance) - : QWidget(parent), m_base_instance(base_instance), m_ui(new Ui::ResourcePage), m_parent_dialog(parent), m_fetch_progress(this, false) + : QWidget(parent), m_baseInstance(base_instance), m_ui(new Ui::ResourcePage), m_parentDialog(parent), m_fetchProgress(this, false) { m_ui->setupUi(this); @@ -64,18 +64,18 @@ ResourcePage::ResourcePage(ResourceDownloadDialog* parent, BaseInstance& base_in m_ui->versionSelectionBox->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); m_ui->versionSelectionBox->view()->parentWidget()->setMaximumHeight(300); - m_search_timer.setTimerType(Qt::TimerType::CoarseTimer); - m_search_timer.setSingleShot(true); + m_searchTimer.setTimerType(Qt::TimerType::CoarseTimer); + m_searchTimer.setSingleShot(true); - connect(&m_search_timer, &QTimer::timeout, this, &ResourcePage::triggerSearch); + connect(&m_searchTimer, &QTimer::timeout, this, &ResourcePage::triggerSearch); // hide progress bar to prevent weird artifact - m_fetch_progress.hide(); - m_fetch_progress.hideIfInactive(true); - m_fetch_progress.setFixedHeight(24); - m_fetch_progress.progressFormat(""); + m_fetchProgress.hide(); + m_fetchProgress.hideIfInactive(true); + m_fetchProgress.setFixedHeight(24); + m_fetchProgress.progressFormat(""); - m_ui->verticalLayout->insertWidget(1, &m_fetch_progress); + m_ui->verticalLayout->insertWidget(1, &m_fetchProgress); m_ui->packView->setItemDelegate(new ProjectItemDelegate(this)); m_ui->packView->installEventFilter(this); @@ -121,10 +121,10 @@ auto ResourcePage::eventFilter(QObject* watched, QEvent* event) -> bool keyEvent->accept(); return true; } else { - if (m_search_timer.isActive()) - m_search_timer.stop(); + if (m_searchTimer.isActive()) + m_searchTimer.stop(); - m_search_timer.start(350); + m_searchTimer.start(350); } } else if (watched == m_ui->packView) { if (keyEvent->key() == Qt::Key_Return) { @@ -248,7 +248,7 @@ void ResourcePage::updateUi() void ResourcePage::updateSelectionButton() { - if (!isOpened || m_selected_version_index < 0) { + if (!isOpened || m_selectedVersionIndex < 0) { m_ui->resourceSelectionButton->setEnabled(false); return; } @@ -258,7 +258,7 @@ void ResourcePage::updateSelectionButton() if (current_pack->versionsLoaded && current_pack->versions.empty()) { m_ui->resourceSelectionButton->setEnabled(false); qWarning() << tr("No version available for the selected pack"); - } else if (!current_pack->isVersionSelected(m_selected_version_index)) + } else if (!current_pack->isVersionSelected(m_selectedVersionIndex)) m_ui->resourceSelectionButton->setText(tr("Select %1 for download").arg(resourceString())); else m_ui->resourceSelectionButton->setText(tr("Deselect %1 for download").arg(resourceString())); @@ -327,18 +327,18 @@ void ResourcePage::onSelectionChanged(QModelIndex curr, [[maybe_unused]] QModelI void ResourcePage::onVersionSelectionChanged(int) { - m_selected_version_index = m_ui->versionSelectionBox->currentData().toInt(); + m_selectedVersionIndex = m_ui->versionSelectionBox->currentData().toInt(); updateSelectionButton(); } void ResourcePage::addResourceToDialog(ModPlatform::IndexedPack::Ptr pack, ModPlatform::IndexedVersion& version) { - m_parent_dialog->addResource(pack, version); + m_parentDialog->addResource(pack, version); } void ResourcePage::removeResourceFromDialog(const QString& pack_name) { - m_parent_dialog->removeResource(pack_name); + m_parentDialog->removeResource(pack_name); } void ResourcePage::addResourceToPage(ModPlatform::IndexedPack::Ptr pack, @@ -355,14 +355,14 @@ void ResourcePage::removeResourceFromPage(const QString& name) void ResourcePage::onResourceSelected() { - if (m_selected_version_index < 0) + if (m_selectedVersionIndex < 0) return; auto current_pack = getCurrentPack(); - if (!current_pack || !current_pack->versionsLoaded || current_pack->versions.size() < m_selected_version_index) + if (!current_pack || !current_pack->versionsLoaded || current_pack->versions.size() < m_selectedVersionIndex) return; - auto& version = current_pack->versions[m_selected_version_index]; + auto& version = current_pack->versions[m_selectedVersionIndex]; if (version.downloadUrl.isNull()) { CustomMessageBox::selectable(this, tr("How?"), "You managed to select a resource that doesn't have a download link. Because of this missing " @@ -409,14 +409,14 @@ void ResourcePage::openUrl(const QUrl& url) } } - if (!page.isNull() && !m_do_not_jump_to_mod) { + if (!page.isNull() && !m_doNotJumpToMod) { const QString slug = match.captured(1); // ensure the user isn't opening the same mod if (auto current_pack = getCurrentPack(); current_pack && slug != current_pack->slug) { - m_parent_dialog->selectPage(page); + m_parentDialog->selectPage(page); - auto newPage = m_parent_dialog->selectedPage(); + auto newPage = m_parentDialog->selectedPage(); QLineEdit* searchEdit = newPage->m_ui->searchEdit; auto model = newPage->m_model; @@ -460,7 +460,7 @@ void ResourcePage::openProject(QVariant projectID) m_ui->resourceFilterButton->hide(); m_ui->packView->hide(); m_ui->resourceSelectionButton->hide(); - m_do_not_jump_to_mod = true; + m_doNotJumpToMod = true; auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); @@ -478,10 +478,10 @@ void ResourcePage::openProject(QVariant projectID) connect(okBtn, &QPushButton::clicked, this, [this] { onResourceSelected(); - m_parent_dialog->accept(); + m_parentDialog->accept(); }); - connect(cancelBtn, &QPushButton::clicked, m_parent_dialog, &ResourceDownloadDialog::reject); + connect(cancelBtn, &QPushButton::clicked, m_parentDialog, &ResourceDownloadDialog::reject); m_ui->gridLayout_4->addWidget(buttonBox, 1, 2); auto jump = [this, okBtn] { diff --git a/launcher/ui/pages/modplatform/ResourcePage.h b/launcher/ui/pages/modplatform/ResourcePage.h index b625240eb..09c512df4 100644 --- a/launcher/ui/pages/modplatform/ResourcePage.h +++ b/launcher/ui/pages/modplatform/ResourcePage.h @@ -62,7 +62,7 @@ class ResourcePage : public QWidget, public BasePage { [[nodiscard]] bool setCurrentPack(ModPlatform::IndexedPack::Ptr); [[nodiscard]] auto getCurrentPack() const -> ModPlatform::IndexedPack::Ptr; - [[nodiscard]] auto getDialog() const -> const ResourceDownloadDialog* { return m_parent_dialog; } + [[nodiscard]] auto getDialog() const -> const ResourceDownloadDialog* { return m_parentDialog; } [[nodiscard]] auto getModel() const -> ResourceModel* { return m_model; } protected: @@ -99,22 +99,22 @@ class ResourcePage : public QWidget, public BasePage { virtual void openUrl(const QUrl&); public: - BaseInstance& m_base_instance; + BaseInstance& m_baseInstance; protected: Ui::ResourcePage* m_ui; - ResourceDownloadDialog* m_parent_dialog = nullptr; + ResourceDownloadDialog* m_parentDialog = nullptr; ResourceModel* m_model = nullptr; - int m_selected_version_index = -1; + int m_selectedVersionIndex = -1; - ProgressWidget m_fetch_progress; + ProgressWidget m_fetchProgress; // Used to do instant searching with a delay to cache quick changes - QTimer m_search_timer; + QTimer m_searchTimer; - bool m_do_not_jump_to_mod = false; + bool m_doNotJumpToMod = false; }; } // namespace ResourceDownload diff --git a/launcher/ui/pages/modplatform/ShaderPackPage.cpp b/launcher/ui/pages/modplatform/ShaderPackPage.cpp index ebd8d4ea2..cedf985fb 100644 --- a/launcher/ui/pages/modplatform/ShaderPackPage.cpp +++ b/launcher/ui/pages/modplatform/ShaderPackPage.cpp @@ -31,7 +31,7 @@ void ShaderPackResourcePage::triggerSearch() updateSelectionButton(); static_cast(m_model)->searchWithTerm(getSearchTerm(), m_ui->sortByBox->currentData().toUInt()); - m_fetch_progress.watch(m_model->activeSearchJob().get()); + m_fetchProgress.watch(m_model->activeSearchJob().get()); } QMap ShaderPackResourcePage::urlHandlers() const diff --git a/launcher/ui/pages/modplatform/flame/FlameResourcePages.cpp b/launcher/ui/pages/modplatform/flame/FlameResourcePages.cpp index ce8c03fa1..4e01f3a65 100644 --- a/launcher/ui/pages/modplatform/flame/FlameResourcePages.cpp +++ b/launcher/ui/pages/modplatform/flame/FlameResourcePages.cpp @@ -209,7 +209,7 @@ auto FlameShaderPackPage::shouldDisplay() const -> bool unique_qobject_ptr FlameModPage::createFilterWidget() { - return ModFilterWidget::create(&static_cast(m_base_instance), false, this); + return ModFilterWidget::create(&static_cast(m_baseInstance), false, this); } void FlameModPage::prepareProviderCategories() diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthResourcePages.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthResourcePages.cpp index 85dcde471..4ee620677 100644 --- a/launcher/ui/pages/modplatform/modrinth/ModrinthResourcePages.cpp +++ b/launcher/ui/pages/modplatform/modrinth/ModrinthResourcePages.cpp @@ -144,7 +144,7 @@ auto ModrinthShaderPackPage::shouldDisplay() const -> bool unique_qobject_ptr ModrinthModPage::createFilterWidget() { - return ModFilterWidget::create(&static_cast(m_base_instance), true, this); + return ModFilterWidget::create(&static_cast(m_baseInstance), true, this); } void ModrinthModPage::prepareProviderCategories() From 1e696328bb89ce363e36d3c460b9ec05709b8644 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Sun, 27 Oct 2024 03:05:56 +0200 Subject: [PATCH 3/6] fix #3001 Signed-off-by: Trial97 (cherry picked from commit b593ff09e9c4b5fa30ca082eea4cd69f12a286e5) --- launcher/ui/pages/modplatform/ResourcePage.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/launcher/ui/pages/modplatform/ResourcePage.cpp b/launcher/ui/pages/modplatform/ResourcePage.cpp index 1fcc2bdd8..80258946c 100644 --- a/launcher/ui/pages/modplatform/ResourcePage.cpp +++ b/launcher/ui/pages/modplatform/ResourcePage.cpp @@ -484,11 +484,13 @@ void ResourcePage::openProject(QVariant projectID) connect(cancelBtn, &QPushButton::clicked, m_parentDialog, &ResourceDownloadDialog::reject); m_ui->gridLayout_4->addWidget(buttonBox, 1, 2); - auto jump = [this, okBtn] { + connect(m_ui->versionSelectionBox, QOverload::of(&QComboBox::currentIndexChanged), this, + [this, okBtn] { okBtn->setEnabled(m_ui->versionSelectionBox->currentData().toInt() >= 0); }); + + auto jump = [this] { for (int row = 0; row < m_model->rowCount({}); row++) { const QModelIndex index = m_model->index(row); m_ui->packView->setCurrentIndex(index); - okBtn->setEnabled(true); return; } m_ui->packDescription->setText(tr("The resource was not found")); From c3cf5d31da70ed980ebab0cbf0a2216156dc835c Mon Sep 17 00:00:00 2001 From: Trial97 Date: Mon, 28 Oct 2024 12:54:21 +0200 Subject: [PATCH 4/6] replace currentData with itemData on QComboBox::currentIndexChanged slots Signed-off-by: Trial97 (cherry picked from commit 0cafac84ac6328fefb8992de2c6a2385b1c0053c) --- launcher/ui/pages/modplatform/ResourcePage.cpp | 14 +++++++------- launcher/ui/pages/modplatform/flame/FlamePage.cpp | 2 +- .../ui/pages/modplatform/modrinth/ModrinthPage.cpp | 2 +- launcher/ui/widgets/ThemeCustomizationWidget.cpp | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/launcher/ui/pages/modplatform/ResourcePage.cpp b/launcher/ui/pages/modplatform/ResourcePage.cpp index 80258946c..2c2f97b77 100644 --- a/launcher/ui/pages/modplatform/ResourcePage.cpp +++ b/launcher/ui/pages/modplatform/ResourcePage.cpp @@ -325,9 +325,9 @@ void ResourcePage::onSelectionChanged(QModelIndex curr, [[maybe_unused]] QModelI updateUi(); } -void ResourcePage::onVersionSelectionChanged(int) +void ResourcePage::onVersionSelectionChanged(int index) { - m_selectedVersionIndex = m_ui->versionSelectionBox->currentData().toInt(); + m_selectedVersionIndex = m_ui->versionSelectionBox->itemData(index).toInt(); updateSelectionButton(); } @@ -364,10 +364,10 @@ void ResourcePage::onResourceSelected() auto& version = current_pack->versions[m_selectedVersionIndex]; if (version.downloadUrl.isNull()) { - CustomMessageBox::selectable(this, tr("How?"), - "You managed to select a resource that doesn't have a download link. Because of this missing " - "information prism will not try to download it.", - QMessageBox::Warning) + CustomMessageBox::selectable( + this, tr("Download Link Missing"), + tr("It looks like the resource you selected doesn't have a download link, so Prism won't attempt to download it."), + QMessageBox::Warning) ->show(); return; } @@ -485,7 +485,7 @@ void ResourcePage::openProject(QVariant projectID) m_ui->gridLayout_4->addWidget(buttonBox, 1, 2); connect(m_ui->versionSelectionBox, QOverload::of(&QComboBox::currentIndexChanged), this, - [this, okBtn] { okBtn->setEnabled(m_ui->versionSelectionBox->currentData().toInt() >= 0); }); + [this, okBtn](int index) { okBtn->setEnabled(m_ui->versionSelectionBox->itemData(index).toInt() >= 0); }); auto jump = [this] { for (int row = 0; row < m_model->rowCount({}); row++) { diff --git a/launcher/ui/pages/modplatform/flame/FlamePage.cpp b/launcher/ui/pages/modplatform/flame/FlamePage.cpp index 9abf4a9c6..de6b3d633 100644 --- a/launcher/ui/pages/modplatform/flame/FlamePage.cpp +++ b/launcher/ui/pages/modplatform/flame/FlamePage.cpp @@ -273,7 +273,7 @@ void FlamePage::suggestCurrent() void FlamePage::onVersionSelectionChanged(int index) { bool is_blocked = false; - ui->versionSelectionBox->currentData().toInt(&is_blocked); + ui->versionSelectionBox->itemData(index).toInt(&is_blocked); if (index == -1 || is_blocked) { m_selected_version_index = -1; diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp index 8803c6dd9..7d70abec4 100644 --- a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp +++ b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp @@ -375,7 +375,7 @@ void ModrinthPage::onVersionSelectionChanged(int index) selectedVersion = ""; return; } - selectedVersion = ui->versionSelectionBox->currentData().toString(); + selectedVersion = ui->versionSelectionBox->itemData(index).toString(); suggestCurrent(); } diff --git a/launcher/ui/widgets/ThemeCustomizationWidget.cpp b/launcher/ui/widgets/ThemeCustomizationWidget.cpp index 7a54bd390..097678b8d 100644 --- a/launcher/ui/widgets/ThemeCustomizationWidget.cpp +++ b/launcher/ui/widgets/ThemeCustomizationWidget.cpp @@ -87,7 +87,7 @@ void ThemeCustomizationWidget::applyIconTheme(int index) { auto settings = APPLICATION->settings(); auto originalIconTheme = settings->get("IconTheme").toString(); - auto newIconTheme = ui->iconsComboBox->currentData().toString(); + auto newIconTheme = ui->iconsComboBox->itemData(index).toString(); if (originalIconTheme != newIconTheme) { settings->set("IconTheme", newIconTheme); APPLICATION->themeManager()->applyCurrentlySelectedTheme(); @@ -100,7 +100,7 @@ void ThemeCustomizationWidget::applyWidgetTheme(int index) { auto settings = APPLICATION->settings(); auto originalAppTheme = settings->get("ApplicationTheme").toString(); - auto newAppTheme = ui->widgetStyleComboBox->currentData().toString(); + auto newAppTheme = ui->widgetStyleComboBox->itemData(index).toString(); if (originalAppTheme != newAppTheme) { settings->set("ApplicationTheme", newAppTheme); APPLICATION->themeManager()->applyCurrentlySelectedTheme(); @@ -113,7 +113,7 @@ void ThemeCustomizationWidget::applyCatTheme(int index) { auto settings = APPLICATION->settings(); auto originalCat = settings->get("BackgroundCat").toString(); - auto newCat = ui->backgroundCatComboBox->currentData().toString(); + auto newCat = ui->backgroundCatComboBox->itemData(index).toString(); if (originalCat != newCat) { settings->set("BackgroundCat", newCat); } From db32b2ad992a534b8824d905339ba15d3bf371f8 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Mon, 28 Oct 2024 19:19:06 +0200 Subject: [PATCH 5/6] remove message box Signed-off-by: Trial97 (cherry picked from commit 9cdda4377b0090a035e286a86fd78f126f995356) --- launcher/ui/pages/modplatform/ResourcePage.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/launcher/ui/pages/modplatform/ResourcePage.cpp b/launcher/ui/pages/modplatform/ResourcePage.cpp index 2c2f97b77..77cbe29a3 100644 --- a/launcher/ui/pages/modplatform/ResourcePage.cpp +++ b/launcher/ui/pages/modplatform/ResourcePage.cpp @@ -364,11 +364,7 @@ void ResourcePage::onResourceSelected() auto& version = current_pack->versions[m_selectedVersionIndex]; if (version.downloadUrl.isNull()) { - CustomMessageBox::selectable( - this, tr("Download Link Missing"), - tr("It looks like the resource you selected doesn't have a download link, so Prism won't attempt to download it."), - QMessageBox::Warning) - ->show(); + qCritical() << tr("It looks like the resource you selected doesn't have a download link, so Prism won't attempt to download it."); return; } if (version.is_currently_selected) From 63a6f823fd9a35c749f061b26f53d5b0623f50cf Mon Sep 17 00:00:00 2001 From: Trial97 Date: Mon, 28 Oct 2024 22:27:40 +0200 Subject: [PATCH 6/6] add qassert Signed-off-by: Trial97 (cherry picked from commit 94f65f8727bfd12cc50eb8b62d52bca308cef9b5) --- launcher/ui/pages/modplatform/ResourcePage.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/launcher/ui/pages/modplatform/ResourcePage.cpp b/launcher/ui/pages/modplatform/ResourcePage.cpp index 77cbe29a3..766070f20 100644 --- a/launcher/ui/pages/modplatform/ResourcePage.cpp +++ b/launcher/ui/pages/modplatform/ResourcePage.cpp @@ -363,10 +363,7 @@ void ResourcePage::onResourceSelected() return; auto& version = current_pack->versions[m_selectedVersionIndex]; - if (version.downloadUrl.isNull()) { - qCritical() << tr("It looks like the resource you selected doesn't have a download link, so Prism won't attempt to download it."); - return; - } + Q_ASSERT(!version.downloadUrl.isNull()); if (version.is_currently_selected) removeResourceFromDialog(current_pack->name); else