Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-11-18 22:14:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-11-18 22:27:17 +0300
commit074cd53c19311955031f88d2486ac475ba43f806 (patch)
treed83f1daaeb4e7a6aa6a6218a5d3009a6338ebaf6 /source/blender/makesrna/intern/rna_wm.c
parent64920a8febde6df596fe7c8e62c570db2f29ab95 (diff)
Keymap: move left click select to a preference
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm.c')
-rw-r--r--source/blender/makesrna/intern/rna_wm.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 6ad5e365e03..ab06673fe71 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -996,17 +996,7 @@ static PointerRNA rna_wmKeyConfig_preferences_get(PointerRNA *ptr)
wmKeyConfig *kc = ptr->data;
wmKeyConfigPrefType_Runtime *kpt_rt = BKE_keyconfig_pref_type_find(kc->idname, true);
if (kpt_rt) {
- wmKeyConfigPrefType *kpt = BLI_findstring(
- &U.user_keyconfig_prefs, kc->idname, offsetof(wmKeyConfigPrefType, idname));
- if (kpt == NULL) {
- kpt = MEM_callocN(sizeof(*kpt), __func__);
- STRNCPY(kpt->idname, kc->idname);
- BLI_addtail(&U.user_keyconfig_prefs, kpt);
- }
- if (kpt->prop == NULL) {
- IDPropertyTemplate val = {0};
- kpt->prop = IDP_New(IDP_GROUP, &val, kc->idname); /* name is unimportant */
- }
+ wmKeyConfigPref *kpt = BKE_keyconfig_pref_ensure(&U, kc->idname);
return rna_pointer_inherit_refine(ptr, kpt_rt->ext.srna, kpt->prop);
}
else {
@@ -1045,7 +1035,7 @@ static StructRNA *rna_wmKeyConfigPref_register(
StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
wmKeyConfigPrefType_Runtime *kpt_rt, dummy_kpt_rt = {{'\0'}};
- wmKeyConfigPrefType dummy_kpt = {NULL};
+ wmKeyConfigPref dummy_kpt = {NULL};
PointerRNA dummy_ptr;
// int have_function[1];
@@ -2317,7 +2307,7 @@ static void rna_def_keyconfig_prefs(BlenderRNA *brna)
srna = RNA_def_struct(brna, "KeyConfigPreferences", NULL);
RNA_def_struct_ui_text(srna, "Key-Config Preferences", "");
- RNA_def_struct_sdna(srna, "wmKeyConfigPrefType"); /* WARNING: only a bAddon during registration */
+ RNA_def_struct_sdna(srna, "wmKeyConfigPref"); /* WARNING: only a bAddon during registration */
RNA_def_struct_refine_func(srna, "rna_wmKeyConfigPref_refine");
RNA_def_struct_register_funcs(srna, "rna_wmKeyConfigPref_register", "rna_wmKeyConfigPref_unregister", NULL);
@@ -2367,10 +2357,6 @@ static void rna_def_keyconfig(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "User Defined", "Indicates that a keyconfig was defined by the user");
- prop = RNA_def_property(srna, "has_select_mouse", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "has_select_mouse", 1);
- RNA_def_property_ui_text(prop, "Has Select Mouse", "Configuration supports select mouse switching");
-
/* Collection active property */
prop = RNA_def_property(srna, "preferences", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "KeyConfigPreferences");