| 324 | } |
| 325 | |
| 326 | void GraphicPacksWindow2::SaveStateToConfig() |
| 327 | { |
| 328 | auto& data = g_config.data(); |
| 329 | data.graphic_pack_entries.clear(); |
| 330 | |
| 331 | for (const auto& gp : GraphicPack2::GetGraphicPacks()) |
| 332 | { |
| 333 | auto filename = _utf8ToPath(gp->GetNormalizedPathString()); |
| 334 | if (gp->IsEnabled()) |
| 335 | { |
| 336 | data.graphic_pack_entries.try_emplace(filename); |
| 337 | auto& it = data.graphic_pack_entries[filename]; |
| 338 | // otherwise store all selected presets |
| 339 | for (const auto& preset : gp->GetActivePresets()) |
| 340 | it.try_emplace(preset->category, preset->name); |
| 341 | } |
| 342 | else if(gp->IsDefaultEnabled()) |
| 343 | { |
| 344 | // save that its disabled |
| 345 | data.graphic_pack_entries.try_emplace(filename); |
| 346 | auto& it = data.graphic_pack_entries[filename]; |
| 347 | it.try_emplace("_disabled", "false"); |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | g_config.Save(); |
| 352 | } |
| 353 | |
| 354 | GraphicPacksWindow2::~GraphicPacksWindow2() |
| 355 | { |
nothing calls this directly
no test coverage detected