diff --git a/lib/libimhex/source/api/content_registry.cpp b/lib/libimhex/source/api/content_registry.cpp index 1fbf3a0b7..f31090788 100644 --- a/lib/libimhex/source/api/content_registry.cpp +++ b/lib/libimhex/source/api/content_registry.cpp @@ -154,18 +154,10 @@ namespace hex { if (!s_settings.isValid()) return; - for (const auto &category : getSettings()) { - for (const auto &subCategory : category.subCategories) { - for (const auto &entry : subCategory.entries) { - (*s_settings)[category.unlocalizedName][entry.unlocalizedName] = entry.widget->store(); - } - } - } - const auto &settingsData = *s_settings; // During a crash settings can be empty, causing them to be overwritten. - if (settingsData.empty()) { + if (s_settings->empty()) { return; } diff --git a/plugins/builtin/source/content/settings_entries.cpp b/plugins/builtin/source/content/settings_entries.cpp index 22b423720..9028d3f8c 100644 --- a/plugins/builtin/source/content/settings_entries.cpp +++ b/plugins/builtin/source/content/settings_entries.cpp @@ -1002,6 +1002,7 @@ namespace hex::plugin::builtin { for (const auto &entry : subcategory.entries) { if (auto keybindingWidget = dynamic_cast(entry.widget.get())) { keybindingWidget->reset(); + ContentRegistry::Settings::write(category.unlocalizedName, entry.unlocalizedName, keybindingWidget->store()); } } }