From 821ca7416683a8ac1e9906bb28a31265f67dbb98 Mon Sep 17 00:00:00 2001 From: Al Date: Sat, 12 Jan 2019 20:24:10 +0100 Subject: Avoid refreshes unless it's specifically the update filter. --- src/modlistsortproxy.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/modlistsortproxy.cpp') diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp index bff26e8d..94139715 100644 --- a/src/modlistsortproxy.cpp +++ b/src/modlistsortproxy.cpp @@ -58,18 +58,12 @@ void ModListSortProxy::updateFilterActive() void ModListSortProxy::setCategoryFilter(const std::vector &categories) { - m_CategoryFilter = categories; - updateFilterActive(); - invalidate(); - - //For better performance we could refresh only if the filter is different or - //categories contains CATEGORY_SPECIAL_UPDATEAVAILABLE - /* - if (categories != m_CategoryFilter) { + //avoid refreshing the filter unless we are checking all mods for update. + if (categories != m_CategoryFilter || categories.at(0) == CategoryFactory::CATEGORY_SPECIAL_UPDATEAVAILABLE) { m_CategoryFilter = categories; updateFilterActive(); invalidate(); - }*/ + } } void ModListSortProxy::setContentFilter(const std::vector &content) -- cgit v1.3.1