[Bf-blender-cvs] [db8f662cc98] blender2.8: Cleanup: use define for key-config string

Campbell Barton noreply at git.blender.org
Mon Nov 19 03:17:15 CET 2018


Commit: db8f662cc980a6746de2b8d5f45e74d20ea9085f
Author: Campbell Barton
Date:   Mon Nov 19 13:16:18 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBdb8f662cc980a6746de2b8d5f45e74d20ea9085f

Cleanup: use define for key-config string

===================================================================

M	source/blender/blenloader/intern/versioning_userdef.c
M	source/blender/makesdna/DNA_windowmanager_types.h
M	source/blender/windowmanager/intern/wm.c

===================================================================

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



More information about the Bf-blender-cvs mailing list