fix(ui): Refresh mod list when changing filtering options

This commit is contained in:
flow
2022-04-02 19:21:02 -03:00
parent c730fd6e5f
commit 5cb0e75093
5 changed files with 32 additions and 9 deletions

View File

@ -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)) {