summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLostDragonist <lost.dragonist@gmail.com>2019-01-05 02:56:43 -0600
committerLostDragonist <lost.dragonist@gmail.com>2019-01-05 02:57:01 -0600
commit14782a374c727c8fb2c6733ba0556fca9dc9eda6 (patch)
tree66e91496f7ba1ccacae5632e7b3625629b85d2c6
parent070a9a4d47f6978cf94d0652c7ecda55486ad93f (diff)
Improve performance by removing redundant actions when changing mod states
-rw-r--r--src/modlistsortproxy.cpp16
-rw-r--r--src/organizercore.cpp9
2 files changed, 18 insertions, 7 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
diff --git a/src/organizercore.cpp b/src/organizercore.cpp
index 884b699c..9ebe9f47 100644
--- a/src/organizercore.cpp
+++ b/src/organizercore.cpp
@@ -1787,7 +1787,9 @@ void OrganizerCore::updateModActiveState(int index, bool active)
if (active != m_PluginList.isEnabled(esm)
&& file->getAlternatives().empty()) {
+ m_PluginList.blockSignals(true);
m_PluginList.enableESP(esm, active);
+ m_PluginList.blockSignals(false);
}
}
int enabled = 0;
@@ -1801,7 +1803,9 @@ void OrganizerCore::updateModActiveState(int index, bool active)
if (active != m_PluginList.isEnabled(esl)
&& file->getAlternatives().empty()) {
+ m_PluginList.blockSignals(true);
m_PluginList.enableESP(esl, active);
+ m_PluginList.blockSignals(false);
++enabled;
}
}
@@ -1815,7 +1819,9 @@ void OrganizerCore::updateModActiveState(int index, bool active)
if (active != m_PluginList.isEnabled(esp)
&& file->getAlternatives().empty()) {
+ m_PluginList.blockSignals(true);
m_PluginList.enableESP(esp, active);
+ m_PluginList.blockSignals(false);
++enabled;
}
}
@@ -1842,7 +1848,9 @@ void OrganizerCore::updateModInDirectoryStructure(unsigned int index,
refreshESPList(true);
// activate all esps of the specified mod so the bsas get activated along with
// it
+ m_PluginList.blockSignals(true);
updateModActiveState(index, true);
+ m_PluginList.blockSignals(false);
// now we need to refresh the bsa list and save it so there is no confusion
// about what archives are avaiable and active
refreshBSAList();
@@ -2005,7 +2013,6 @@ void OrganizerCore::modStatusChanged(unsigned int index)
updateModInDirectoryStructure(index, modInfo);
} else {
updateModActiveState(index, false);
- refreshESPList(true);
if (m_DirectoryStructure->originExists(ToWString(modInfo->name()))) {
FilesOrigin &origin
= m_DirectoryStructure->getOriginByName(ToWString(modInfo->name()));