aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/modplatform/ModPage.cpp
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-06-23 20:01:17 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-06-23 20:01:17 +0300
commit69c709b05a90f342cc9d1f9337457bb5519a87a9 (patch)
tree4ff1cbe8123b627bfb171c119b3adc4e2ddaf89b /launcher/ui/pages/modplatform/ModPage.cpp
parent3e3be9ae6f902cc292ee26e4d330b078ddbb2a46 (diff)
parent046d510134a0061c0a1fa89fda80355c9e2f11ff (diff)
downloadPrismLauncher-69c709b05a90f342cc9d1f9337457bb5519a87a9.tar.gz
PrismLauncher-69c709b05a90f342cc9d1f9337457bb5519a87a9.tar.bz2
PrismLauncher-69c709b05a90f342cc9d1f9337457bb5519a87a9.zip
Merge branch 'develop' of https://github.com/PrismLauncher/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.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/launcher/ui/pages/modplatform/ModPage.cpp b/launcher/ui/pages/modplatform/ModPage.cpp
index 95064d16..60a43128 100644
--- a/launcher/ui/pages/modplatform/ModPage.cpp
+++ b/launcher/ui/pages/modplatform/ModPage.cpp
@@ -89,17 +89,13 @@ void ModPage::filterMods()
void ModPage::triggerSearch()
{
- auto changed = m_filter_widget->changed();
m_filter = m_filter_widget->getFilter();
+ m_ui->packView->clearSelection();
+ m_ui->packDescription->clear();
+ m_ui->versionSelectionBox->clear();
+ updateSelectionButton();
- if (changed) {
- m_ui->packView->clearSelection();
- m_ui->packDescription->clear();
- m_ui->versionSelectionBox->clear();
- updateSelectionButton();
- }
-
- static_cast<ModModel*>(m_model)->searchWithTerm(getSearchTerm(), m_ui->sortByBox->currentData().toUInt(), changed);
+ static_cast<ModModel*>(m_model)->searchWithTerm(getSearchTerm(), m_ui->sortByBox->currentData().toUInt(), m_filter_widget->changed());
m_fetch_progress.watch(m_model->activeSearchJob().get());
}
@@ -122,6 +118,8 @@ void ModPage::updateVersionList()
QString mcVersion = packProfile->getComponentVersion("net.minecraft");
auto current_pack = getCurrentPack();
+ if (!current_pack)
+ return;
for (int i = 0; i < current_pack->versions.size(); i++) {
auto version = current_pack->versions[i];
bool valid = false;