Fix error messages removing keymaps from keyconfigs

This commit is contained in:
Campbell Barton
2023-09-13 14:59:36 +10:00
parent ec58f3d4cd
commit d154009910

View File

@@ -387,11 +387,8 @@ static void rna_KeyMap_item_remove(wmKeyMap *km, ReportList *reports, PointerRNA
wmKeyMapItem *kmi = static_cast<wmKeyMapItem *>(kmi_ptr->data);
if (UNLIKELY(BLI_findindex(&km->items, kmi) == -1)) {
BKE_reportf(reports,
RPT_ERROR,
"KeyMapItem '%s' cannot be removed from '%s'",
kmi->idname,
km->idname);
BKE_reportf(
reports, RPT_ERROR, "KeyMapItem '%s' not found in KeyMap '%s'", kmi->idname, km->idname);
return;
}
@@ -484,7 +481,11 @@ static void rna_KeyMap_remove(wmKeyConfig *keyconfig, ReportList *reports, Point
wmKeyMap *keymap = static_cast<wmKeyMap *>(keymap_ptr->data);
if (UNLIKELY(BLI_findindex(&keyconfig->keymaps, keymap) == -1)) {
BKE_reportf(reports, RPT_ERROR, "KeyConfig '%s' cannot be removed", keymap->idname);
BKE_reportf(reports,
RPT_ERROR,
"KeyMap '%s' not found in KeyConfig '%s'",
keymap->idname,
keyconfig->idname);
return;
}