fix(ui): Refresh mod list when changing filtering options
This commit is contained in:
@ -75,11 +75,8 @@ void ListModel::performPaginatedSearch()
|
||||
{ nextSearchOffset, currentSearchTerm, getSorts()[currentSort], profile->getModLoader(), getMineVersions() });
|
||||
}
|
||||
|
||||
void ListModel::searchWithTerm(const QString& term, const int sort)
|
||||
void ListModel::refresh()
|
||||
{
|
||||
if (currentSearchTerm == term && currentSearchTerm.isNull() == term.isNull() && currentSort == sort) { return; }
|
||||
currentSearchTerm = term;
|
||||
currentSort = sort;
|
||||
if (jobPtr) {
|
||||
jobPtr->abort();
|
||||
searchState = ResetRequested;
|
||||
@ -94,6 +91,15 @@ void ListModel::searchWithTerm(const QString& term, const int sort)
|
||||
performPaginatedSearch();
|
||||
}
|
||||
|
||||
void ListModel::searchWithTerm(const QString& term, const int sort)
|
||||
{
|
||||
if (currentSearchTerm == term && currentSearchTerm.isNull() == term.isNull() && currentSort == sort) { return; }
|
||||
currentSearchTerm = term;
|
||||
currentSort = sort;
|
||||
|
||||
refresh();
|
||||
}
|
||||
|
||||
void ListModel::getLogo(const QString& logo, const QString& logoUrl, LogoCallback callback)
|
||||
{
|
||||
if (m_logoMap.contains(logo)) {
|
||||
|
@ -34,6 +34,7 @@ class ListModel : public QAbstractListModel {
|
||||
|
||||
/* Ask the API for more information */
|
||||
void fetchMore(const QModelIndex& parent) override;
|
||||
void refresh();
|
||||
void searchWithTerm(const QString& term, const int sort);
|
||||
void requestModVersions(const ModPlatform::IndexedPack& current);
|
||||
|
||||
|
@ -62,6 +62,13 @@ void ModPage::filterMods()
|
||||
filter_dialog.execWithInstance(static_cast<MinecraftInstance*>(m_instance));
|
||||
|
||||
m_filter = filter_dialog.getFilter();
|
||||
|
||||
listModel->refresh();
|
||||
|
||||
if(ui->versionSelectionBox->count() > 0){
|
||||
ui->versionSelectionBox->clear();
|
||||
updateModVersions();
|
||||
}
|
||||
}
|
||||
|
||||
void ModPage::triggerSearch()
|
||||
|
Reference in New Issue
Block a user