Fix #146670: Disabled key-map items lost when loading old preferences

Version patching keymaps was only handling new/changed key-map items.
However it's important to version patch removed key-map items so they
match the key-map items in the updated key-map and disable them.

Regression from [0] which copied the error from [1].

Resolve both by updating all key-map items.

Ref !147668

[0]: 5e2b421996
[1]: 4986f71848
This commit is contained in:
Campbell Barton
2025-10-09 03:29:44 +00:00
parent a82f3a0fe0
commit f9c7c8fdcb
2 changed files with 4 additions and 6 deletions

View File

@@ -54,6 +54,8 @@ struct wmKeyConfigFilterItemParams {
uint check_diff_item_add : 1;
uint check_diff_item_remove : 1;
};
/** Use when all items should be manipulated. */
#define WM_KEY_CONFIG_FILTER_ITEM_ALL {true, true, true}
void BKE_keyconfig_keymap_filter_item(struct wmKeyMap *keymap,
const struct wmKeyConfigFilterItemParams *params,

View File

@@ -1349,9 +1349,7 @@ void blo_do_versions_userdef(UserDef *userdef)
}
if (!USER_VERSION_ATLEAST(302, 5)) {
wmKeyConfigFilterItemParams params{};
params.check_item = true;
params.check_diff_item_add = true;
const wmKeyConfigFilterItemParams params = WM_KEY_CONFIG_FILTER_ITEM_ALL;
BKE_keyconfig_pref_filter_items(userdef, &params, keymap_item_update_tweak_event, nullptr);
}
@@ -1609,9 +1607,7 @@ void blo_do_versions_userdef(UserDef *userdef)
}
if (!USER_VERSION_ATLEAST(405, 11)) {
wmKeyConfigFilterItemParams params{};
params.check_item = true;
params.check_diff_item_add = true;
const wmKeyConfigFilterItemParams params = WM_KEY_CONFIG_FILTER_ITEM_ALL;
BKE_keyconfig_pref_filter_items(
userdef,
&params,