mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-29 00:10:02 -05:00
fix: Settings not being saved correctly anymore
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1002,6 +1002,7 @@ namespace hex::plugin::builtin {
|
||||
for (const auto &entry : subcategory.entries) {
|
||||
if (auto keybindingWidget = dynamic_cast<KeybindingWidget*>(entry.widget.get())) {
|
||||
keybindingWidget->reset();
|
||||
ContentRegistry::Settings::write<nlohmann::json>(category.unlocalizedName, entry.unlocalizedName, keybindingWidget->store());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user