From 14782a374c727c8fb2c6733ba0556fca9dc9eda6 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Sat, 5 Jan 2019 02:56:43 -0600 Subject: Improve performance by removing redundant actions when changing mod states --- src/organizercore.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/organizercore.cpp') 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())); -- cgit v1.3.1