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

Method commitChanges

src/editexecutablesdialog.cpp:229–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229bool EditExecutablesDialog::commitChanges()
230{
231 const auto newExecutables = getExecutablesList();
232
233 if (!checkOutputMods(newExecutables)) {
234 return false;
235 }
236
237 auto* profile = m_organizerCore.currentProfile();
238
239 // remove all the custom overwrites and forced libraries
240 for (const auto& e : m_originalExecutables) {
241 profile->removeSetting("custom_overwrites", e.title());
242 profile->removeForcedLibraries(e.title());
243 }
244
245 // set the new custom overwrites and forced libraries
246 for (const auto& e : newExecutables) {
247 if (auto modName = m_customOverwrites.find(e.title())) {
248 if (modName && modName->enabled) {
249 profile->storeSetting("custom_overwrites", e.title(), modName->value);
250 }
251 }
252
253 if (auto libraryList = m_forcedLibraries.find(e.title())) {
254 if (libraryList && !libraryList->value.empty()) {
255 profile->setForcedLibrariesEnabled(e.title(), libraryList->enabled);
256 profile->storeForcedLibraries(e.title(), libraryList->value);
257 }
258 }
259 }
260
261 // set the new executables list
262 m_organizerCore.setExecutablesList(newExecutables);
263
264 setDirty(false);
265
266 return true;
267}
268
269void EditExecutablesDialog::setDirty(bool b)
270{

Callers

nothing calls this directly

Calls 9

currentProfileMethod · 0.80
removeSettingMethod · 0.80
removeForcedLibrariesMethod · 0.80
storeSettingMethod · 0.80
storeForcedLibrariesMethod · 0.80
setExecutablesListMethod · 0.80
findMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected