Cleanup: use define for key-config string
authorCampbell Barton <ideasman42@gmail.com>
Mon, 19 Nov 2018 02:16:18 +0000 (13:16 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 19 Nov 2018 02:16:18 +0000 (13:16 +1100)
source/blender/blenloader/intern/versioning_userdef.c
source/blender/makesdna/DNA_windowmanager_types.h
source/blender/windowmanager/intern/wm.c

index 8d8369bc2ef0e0c737e13de7b9bbff83a0a89f29..5279ed19343e7d9496df87d9956158d13c79dd7a 100644 (file)
@@ -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"));
                }
        }
index 193c34e3d1198da44d60432d438b250ec9027174..1fdd4d10586555b736ffc780fa17e899374224ab 100644 (file)
@@ -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__
index 06ae1e498b7aad51b9385fd72910ec8b1674f607..866c846810bc6c2a4b22baa79a59f7eefb6cb796 100644 (file)
@@ -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