diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-19 05:16:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-19 05:16:18 +0300 |
commit | db8f662cc980a6746de2b8d5f45e74d20ea9085f (patch) | |
tree | 94139ef6430c7b098fa978d8673aeaef321f821f | |
parent | 472b1147610088de233948fcbd7ac4d992da3e36 (diff) |
Cleanup: use define for key-config string
-rw-r--r-- | source/blender/blenloader/intern/versioning_userdef.c | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_windowmanager_types.h | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm.c | 6 |
3 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c index 8d8369bc2ef..5279ed19343 100644 --- a/source/blender/blenloader/intern/versioning_userdef.c +++ b/source/blender/blenloader/intern/versioning_userdef.c @@ -401,7 +401,7 @@ void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef) if (!USER_VERSION_ATLEAST(280, 32)) { if ((userdef->flag & USER_LMOUSESELECT) ) { userdef->flag &= ~USER_LMOUSESELECT; - wmKeyConfigPref *kpt = BKE_keyconfig_pref_ensure(userdef, "blender"); + wmKeyConfigPref *kpt = BKE_keyconfig_pref_ensure(userdef, WM_KEYCONFIG_STR_DEFAULT); IDP_AddToGroup(kpt->prop, IDP_New(IDP_INT, &(IDPropertyTemplate){ .i = 0, }, "select_mouse")); } } diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index 193c34e3d11..1fdd4d10586 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -171,6 +171,8 @@ enum { WM_KEYCONFIG_IS_INITIALIZED = (1<<1), }; +#define WM_KEYCONFIG_STR_DEFAULT "blender" + /* IME is win32 only! */ #ifndef WIN32 # ifdef __GNUC__ diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index 06ae1e498b7..866c846810b 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -241,13 +241,13 @@ void WM_keyconfig_init(bContext *C) /* create standard key configs */ if (wm->defaultconf == NULL) { /* Keep lowercase to match the preset filename. */ - wm->defaultconf = WM_keyconfig_new(wm, "blender", false); + wm->defaultconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT, false); } if (wm->addonconf == NULL) { - wm->addonconf = WM_keyconfig_new(wm, "blender addon", false); + wm->addonconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT " addon", false); } if (wm->userconf == NULL) { - wm->userconf = WM_keyconfig_new(wm, "blender user", false); + wm->userconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT " user", false); } /* initialize only after python init is done, for keymaps that |