summaryrefslogtreecommitdiff
path: root/src/modlistsortproxy.cpp
diff options
context:
space:
mode:
authorAl <gabriel.cortesi@outlook.com>2019-01-12 20:24:10 +0100
committerAl <gabriel.cortesi@outlook.com>2019-01-12 20:24:10 +0100
commit821ca7416683a8ac1e9906bb28a31265f67dbb98 (patch)
tree2482332ca0ac25c0d125f8f874f1e2e677254fcf /src/modlistsortproxy.cpp
parent864cab8c8afe9afc2a329d8849d2eee336a6898f (diff)
Avoid refreshes unless it's specifically the update filter.
Diffstat (limited to 'src/modlistsortproxy.cpp')
-rw-r--r--src/modlistsortproxy.cpp12
1 files changed, 3 insertions, 9 deletions
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<int> &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<int> &content)