From 63bce0464895236a043aa8a98e2905ab1bf34cc1 Mon Sep 17 00:00:00 2001 From: flow Date: Sun, 3 Apr 2022 10:21:48 -0300 Subject: fix: Polish usage in some cases Also fiz some typos --- launcher/ui/pages/modplatform/flame/FlameModPage.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'launcher/ui/pages/modplatform/flame') 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(m_instance)); - - int prev_size = m_filter->versions.size(); + auto ret = filter_dialog.execWithInstance(static_cast(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); } } -- cgit