From 95b28a65f366c4a1f571f35dabd79edaa94cfe51 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 8 Feb 2013 15:16:57 +0000 Subject: Cleanup: happily remove no-more-used PY_TRANSLATE RNA prop flag, and related code (just realized that flag value was wrong, probably own typo in a previous commit :/ ). That "trick" was nice when introduced, but it became kind of a pita since we added translation contexts... --- source/blender/blenlib/BLI_utildefines.h | 4 ++-- source/blender/makesrna/RNA_define.h | 1 - source/blender/makesrna/RNA_types.h | 7 +------ source/blender/makesrna/intern/rna_define.c | 15 --------------- source/blender/python/intern/bpy_rna.c | 11 ----------- 5 files changed, 3 insertions(+), 35 deletions(-) (limited to 'source') diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index 983fc421d46..95ad786c7c2 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -46,8 +46,8 @@ typedef bool _BLI_Bool; # else /* using char here may cause nasty tricky bugs, e.g. - * bool do_translate = RNA_property_flag(prop) & PROP_STRING_PY_TRANSLATE; - * as PROP_STRING_PY_TRANSLATE is farther than 8th bit, do_translate would be always false! + * bool is_bit_flag = RNA_property_flag(prop) & PROP_ENUM_FLAG; + * as PROP_ENUM_FLAG is farther than 8th bit, do_translate would be always false! */ # define _BLI_Bool unsigned int # endif diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index 0d6e66904e7..5ab37c6d97b 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -88,7 +88,6 @@ PropertyRNA *RNA_def_string(StructOrFunctionRNA *cont, const char *identifier, c PropertyRNA *RNA_def_string_file_path(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description); PropertyRNA *RNA_def_string_dir_path(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description); PropertyRNA *RNA_def_string_file_name(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description); -PropertyRNA *RNA_def_string_py_translate(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description); PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description); PropertyRNA *RNA_def_enum_flag(StructOrFunctionRNA *cont, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description); diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 300134fc8b6..d3cf7dc8095 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -143,7 +143,7 @@ typedef enum PropertySubType { } PropertySubType; /* Make sure enums are updated with thses */ -/* HIGHEST FLAG IN USE: 1 << 29 */ +/* HIGHEST FLAG IN USE: 1 << 28 */ typedef enum PropertyFlag { /* editable means the property is editable in the user * interface, properties are editable by default except @@ -200,11 +200,6 @@ typedef enum PropertyFlag { */ PROP_ENUM_FLAG = (1 << 21), - /* A string which should be translated when converting from py string to RNA prop. - * Should only be used in some functions' properties (currently only "text" one of funcs in UI API). - */ - PROP_STRING_PY_TRANSLATE = (1 << 28), - /* need context for update function */ PROP_CONTEXT_UPDATE = (1 << 22), PROP_CONTEXT_PROPERTY_UPDATE = (1 << 22) | (1 << 27), diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 2719016856d..c32255ac645 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -2574,21 +2574,6 @@ PropertyRNA *RNA_def_string_file_name(StructOrFunctionRNA *cont_, const char *id return prop; } -PropertyRNA *RNA_def_string_py_translate(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, - int maxlen, const char *ui_name, const char *ui_description) -{ - ContainerRNA *cont = cont_; - PropertyRNA *prop; - - prop = RNA_def_property(cont, identifier, PROP_STRING, PROP_NONE); - RNA_def_property_flag(prop, PROP_STRING_PY_TRANSLATE); - if (maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen); - if (default_value) RNA_def_property_string_default(prop, default_value); - RNA_def_property_ui_text(prop, ui_name, ui_description); - - return prop; -} - PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description) { diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 78d6be6b539..19ec35ae357 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1624,10 +1624,6 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb } else { /* Unicode String */ -#ifdef WITH_INTERNATIONAL - bool do_translate = RNA_property_flag(prop) & PROP_STRING_PY_TRANSLATE; -#endif /* WITH_INTERNATIONAL */ - #ifdef USE_STRING_COERCE PyObject *value_coerce = NULL; if (ELEM3(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) { @@ -1641,13 +1637,6 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb param = _PyUnicode_AsString(value); #endif /* USE_STRING_COERCE */ - /* Any half-brained compiler should be able to optimize this out when WITH_INTERNATIONAL is off */ -#ifdef WITH_INTERNATIONAL - if (do_translate) { - param = IFACE_(param); - } -#endif - if (param == NULL) { if (PyUnicode_Check(value)) { /* there was an error assigning a string type, -- cgit v1.2.3