diff options
| author | LostDragonist <lost.dragonist@gmail.com> | 2019-01-05 02:56:43 -0600 |
|---|---|---|
| committer | LostDragonist <lost.dragonist@gmail.com> | 2019-01-05 02:57:01 -0600 |
| commit | 14782a374c727c8fb2c6733ba0556fca9dc9eda6 (patch) | |
| tree | 66e91496f7ba1ccacae5632e7b3625629b85d2c6 /src/modlistsortproxy.cpp | |
| parent | 070a9a4d47f6978cf94d0652c7ecda55486ad93f (diff) | |
Improve performance by removing redundant actions when changing mod states
Diffstat (limited to 'src/modlistsortproxy.cpp')
| -rw-r--r-- | src/modlistsortproxy.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp index 833e16c3..1a00d764 100644 --- a/src/modlistsortproxy.cpp +++ b/src/modlistsortproxy.cpp @@ -58,16 +58,20 @@ void ModListSortProxy::updateFilterActive() void ModListSortProxy::setCategoryFilter(const std::vector<int> &categories)
{
- m_CategoryFilter = categories;
- updateFilterActive();
- invalidate();
+ if (categories != m_CategoryFilter) {
+ m_CategoryFilter = categories;
+ updateFilterActive();
+ invalidate();
+ }
}
void ModListSortProxy::setContentFilter(const std::vector<int> &content)
{
- m_ContentFilter = content;
- updateFilterActive();
- invalidate();
+ if (content != m_ContentFilter) {
+ m_ContentFilter = content;
+ updateFilterActive();
+ invalidate();
+ }
}
Qt::ItemFlags ModListSortProxy::flags(const QModelIndex &modelIndex) const
|
