| 227 | } |
| 228 | |
| 229 | bool 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 | |
| 269 | void EditExecutablesDialog::setDirty(bool b) |
| 270 | { |
nothing calls this directly
no test coverage detected