fix: Settings not being saved correctly anymore
This commit is contained in:
parent
d8fb3f526a
commit
525ab8d945
@ -154,18 +154,10 @@ namespace hex {
|
|||||||
if (!s_settings.isValid())
|
if (!s_settings.isValid())
|
||||||
return;
|
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;
|
const auto &settingsData = *s_settings;
|
||||||
|
|
||||||
// During a crash settings can be empty, causing them to be overwritten.
|
// During a crash settings can be empty, causing them to be overwritten.
|
||||||
if (settingsData.empty()) {
|
if (s_settings->empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1002,6 +1002,7 @@ namespace hex::plugin::builtin {
|
|||||||
for (const auto &entry : subcategory.entries) {
|
for (const auto &entry : subcategory.entries) {
|
||||||
if (auto keybindingWidget = dynamic_cast<KeybindingWidget*>(entry.widget.get())) {
|
if (auto keybindingWidget = dynamic_cast<KeybindingWidget*>(entry.widget.get())) {
|
||||||
keybindingWidget->reset();
|
keybindingWidget->reset();
|
||||||
|
ContentRegistry::Settings::write<nlohmann::json>(category.unlocalizedName, entry.unlocalizedName, keybindingWidget->store());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user