MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / onProfileChanged

Method onProfileChanged

src/modlistview.cpp:184–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184void ModListView::onProfileChanged(Profile* oldProfile, Profile* newProfile)
185{
186 const auto perProfileSeparators =
187 m_core->settings().interface().collapsibleSeparatorsPerProfile();
188
189 // save expanded/collapsed state of separators
190 if (oldProfile && perProfileSeparators) {
191 auto& collapsed = m_collapsed[m_byPriorityProxy];
192 oldProfile->storeSetting("UserInterface", "collapsed_separators",
193 QStringList(collapsed.begin(), collapsed.end()));
194 }
195
196 m_sortProxy->setProfile(newProfile);
197 m_byPriorityProxy->setProfile(newProfile);
198
199 if (newProfile && perProfileSeparators) {
200 auto collapsed =
201 newProfile->setting("UserInterface", "collapsed_separators", QStringList())
202 .toStringList();
203 m_collapsed[m_byPriorityProxy] = {collapsed.begin(), collapsed.end()};
204 }
205}
206
207bool ModListView::hasCollapsibleSeparators() const
208{

Callers

nothing calls this directly

Calls 7

storeSettingMethod · 0.80
settingsMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
setProfileMethod · 0.45
settingMethod · 0.45

Tested by

no test coverage detected