aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/modplatform/flame
diff options
context:
space:
mode:
authorflow <thiagodonato300@gmail.com>2022-04-03 10:21:48 -0300
committerflow <thiagodonato300@gmail.com>2022-04-15 08:49:43 -0300
commit63bce0464895236a043aa8a98e2905ab1bf34cc1 (patch)
tree5482ebdb4498bee2923ee099509d02e0a902c2cd /launcher/ui/pages/modplatform/flame
parent76dfb7825ade6554095ac3a09b3accdbd4db5138 (diff)
downloadPrismLauncher-63bce0464895236a043aa8a98e2905ab1bf34cc1.tar.gz
PrismLauncher-63bce0464895236a043aa8a98e2905ab1bf34cc1.tar.bz2
PrismLauncher-63bce0464895236a043aa8a98e2905ab1bf34cc1.zip
fix: Polish usage in some cases
Also fiz some typos
Diffstat (limited to 'launcher/ui/pages/modplatform/flame')
-rw-r--r--launcher/ui/pages/modplatform/flame/FlameModPage.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/launcher/ui/pages/modplatform/flame/FlameModPage.cpp b/launcher/ui/pages/modplatform/flame/FlameModPage.cpp
index 5398bda3..6e666c4c 100644
--- a/launcher/ui/pages/modplatform/flame/FlameModPage.cpp
+++ b/launcher/ui/pages/modplatform/flame/FlameModPage.cpp
@@ -67,22 +67,22 @@ auto FlameModPage::validateVersion(ModPlatform::IndexedVersion& ver, QString min
return ver.mcVersion.contains(mineVer);
}
-// We override this so that it refreshes correctly, otherwise it wouldn't show
-// any mod on the mod list, because the CF API does not support it :(
+// We override this so that it refreshes correctly, otherwise it would show
+// invalid mods on the mod list, because the API would return mods for the
+// wrong mod loader :(
void FlameModPage::filterMods()
{
- filter_dialog.execWithInstance(static_cast<MinecraftInstance*>(m_instance));
-
- int prev_size = m_filter->versions.size();
+ auto ret = filter_dialog.execWithInstance(static_cast<MinecraftInstance*>(m_instance));
m_filter = filter_dialog.getFilter();
- int new_size = m_filter->versions.size();
- if(new_size <= 1 && new_size != prev_size)
- listModel->refresh();
+ if(ret == QDialog::DialogCode::Accepted){
+ // CF API can't handle well this
+ if(!m_filter->versions.empty())
+ listModel->refresh();
- if(ui->versionSelectionBox->count() > 0){
+ int prev_count = ui->versionSelectionBox->count();
ui->versionSelectionBox->clear();
- updateModVersions();
+ updateModVersions(prev_count);
}
}