Fix #28769 & #28768: problem with duplicated keymap items after fix yesterday.

This commit is contained in:
Brecht Van Lommel 2011-09-29 13:52:58 +00:00
parent 081543fee8
commit e276855e60
2 changed files with 12 additions and 3 deletions

@ -295,6 +295,7 @@ typedef struct wmKeyConfig {
/* wmKeyConfig.flag */
#define KEYCONF_USER (1 << 1)
#define KEYCONF_INIT_DEFAULT (1 << 2)
/* this one is the operator itself, stored in files for macros etc */
/* operator + operatortype should be able to redo entirely, but for different contextes */

@ -230,6 +230,7 @@ void WM_keymap_init(bContext *C)
{
wmWindowManager *wm= CTX_wm_manager(C);
/* create standard key configs */
if(!wm->defaultconf)
wm->defaultconf= WM_keyconfig_new(wm, "Blender");
if(!wm->addonconf)
@ -237,11 +238,18 @@ void WM_keymap_init(bContext *C)
if(!wm->userconf)
wm->userconf= WM_keyconfig_new(wm, "Blender User");
/* initialize only after python init is done, for keymaps that
use python operators */
if(CTX_py_init_get(C) && (wm->initialized & WM_INIT_KEYMAP) == 0) {
/* create default key config */
/* create default key config, only initialize once,
it's persistent across sessions */
if(!(wm->defaultconf->flag & KEYCONF_INIT_DEFAULT)) {
wm_window_keymap(wm->defaultconf);
ED_spacetypes_keymap(wm->defaultconf);
wm->defaultconf->flag |= KEYCONF_INIT_DEFAULT;
}
WM_keyconfig_update_tag(NULL, NULL);
WM_keyconfig_update(wm);