aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/modplatform/ModPage.cpp
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-04-22 01:32:33 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-04-22 01:32:33 +0300
commit1d167f8fda8df1b0ded22b8a7dde2cb1a5612542 (patch)
tree6ff7b6aa977c99e6740798e6d8a8c22a69d4e3d6 /launcher/ui/pages/modplatform/ModPage.cpp
parent22bbf1bd1fb789d2542b07fc6bb4140ef7226e36 (diff)
parent460e83207f9ae087846fc9ca210799e41f51a326 (diff)
downloadPrismLauncher-1d167f8fda8df1b0ded22b8a7dde2cb1a5612542.tar.gz
PrismLauncher-1d167f8fda8df1b0ded22b8a7dde2cb1a5612542.tar.bz2
PrismLauncher-1d167f8fda8df1b0ded22b8a7dde2cb1a5612542.zip
Merge branch 'Fix_Assert' of github.com:Trial97/PrismLauncher into develop
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/ui/pages/modplatform/ModPage.cpp')
-rw-r--r--launcher/ui/pages/modplatform/ModPage.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/launcher/ui/pages/modplatform/ModPage.cpp b/launcher/ui/pages/modplatform/ModPage.cpp
index 04be43ad..efff1ff4 100644
--- a/launcher/ui/pages/modplatform/ModPage.cpp
+++ b/launcher/ui/pages/modplatform/ModPage.cpp
@@ -55,8 +55,7 @@
namespace ResourceDownload {
-ModPage::ModPage(ModDownloadDialog* dialog, BaseInstance& instance)
- : ResourcePage(dialog, instance)
+ModPage::ModPage(ModDownloadDialog* dialog, BaseInstance& instance) : ResourcePage(dialog, instance)
{
connect(m_ui->searchButton, &QPushButton::clicked, this, &ModPage::triggerSearch);
connect(m_ui->resourceFilterButton, &QPushButton::clicked, this, &ModPage::filterMods);
@@ -75,12 +74,10 @@ void ModPage::setFilterWidget(unique_qobject_ptr<ModFilterWidget>& widget)
m_filter_widget->setInstance(&static_cast<MinecraftInstance&>(m_base_instance));
m_filter = m_filter_widget->getFilter();
- connect(m_filter_widget.get(), &ModFilterWidget::filterChanged, this, [&]{
- m_ui->searchButton->setStyleSheet("text-decoration: underline");
- });
- connect(m_filter_widget.get(), &ModFilterWidget::filterUnchanged, this, [&]{
- m_ui->searchButton->setStyleSheet("text-decoration: none");
- });
+ connect(m_filter_widget.get(), &ModFilterWidget::filterChanged, this,
+ [&] { m_ui->searchButton->setStyleSheet("text-decoration: underline"); });
+ connect(m_filter_widget.get(), &ModFilterWidget::filterUnchanged, this,
+ [&] { m_ui->searchButton->setStyleSheet("text-decoration: none"); });
}
/******** Callbacks to events in the UI (set up in the derived classes) ********/
@@ -128,8 +125,8 @@ void ModPage::updateVersionList()
for (int i = 0; i < current_pack.versions.size(); i++) {
auto version = current_pack.versions[i];
bool valid = false;
- for(auto& mcVer : m_filter->versions){
- //NOTE: Flame doesn't care about loader, so passing it changes nothing.
+ for (auto& mcVer : m_filter->versions) {
+ // NOTE: Flame doesn't care about loader, so passing it changes nothing.
if (validateVersion(version, mcVer.toString(), packProfile->getModLoaders())) {
valid = true;
break;
@@ -151,6 +148,7 @@ void ModPage::updateVersionList()
void ModPage::addResourceToDialog(ModPlatform::IndexedPack& pack, ModPlatform::IndexedVersion& version)
{
bool is_indexed = !APPLICATION->settings()->get("ModMetadataDisabled").toBool();
+ m_model->addPack(pack);
m_parent_dialog->addResource(pack, version, is_indexed);
}