diff options
Diffstat (limited to 'source/blender/editors/interface/interface_context_menu.c')
-rw-r--r-- | source/blender/editors/interface/interface_context_menu.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c index e167465e178..3c3cb77fc85 100644 --- a/source/blender/editors/interface/interface_context_menu.c +++ b/source/blender/editors/interface/interface_context_menu.c @@ -47,7 +47,10 @@ #include "RNA_access.h" -#include "BPY_extern.h" +#ifdef WITH_PYTHON +# include "BPY_extern.h" +# include "BPY_extern_run.h" +#endif #include "WM_api.h" #include "WM_types.h" @@ -88,7 +91,7 @@ static IDProperty *shortcut_property_from_rna(bContext *C, uiBut *but) /* Create ID property of data path, to pass to the operator. */ IDProperty *prop; - IDPropertyTemplate val = {0}; + const IDPropertyTemplate val = {0}; prop = IDP_New(IDP_GROUP, &val, __func__); IDP_AddToGroup(prop, IDP_NewString(final_data_path, "data_path", strlen(final_data_path) + 1)); @@ -407,7 +410,7 @@ static void ui_but_user_menu_add(bContext *C, uiBut *but, bUserMenu *um) "'%s').label", idname); char *expr_result = NULL; - if (BPY_execute_string_as_string(C, expr_imports, expr, __func__, &expr_result)) { + if (BPY_run_string_as_string(C, expr_imports, expr, __func__, &expr_result)) { STRNCPY(drawstr, expr_result); MEM_freeN(expr_result); } @@ -546,9 +549,9 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but) const PropertyType type = RNA_property_type(prop); const PropertySubType subtype = RNA_property_subtype(prop); bool is_anim = RNA_property_animateable(ptr, prop); - bool is_editable = RNA_property_editable(ptr, prop); - bool is_idprop = RNA_property_is_idprop(prop); - bool is_set = RNA_property_is_set(ptr, prop); + const bool is_editable = RNA_property_editable(ptr, prop); + const bool is_idprop = RNA_property_is_idprop(prop); + const bool is_set = RNA_property_is_set(ptr, prop); /* second slower test, * saved people finding keyframe items in menus when its not possible */ @@ -1042,7 +1045,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but) if (idname != NULL) { uiBlock *block = uiLayoutGetBlock(layout); uiBut *but2; - int w = uiLayoutGetWidth(layout); + const int w = uiLayoutGetWidth(layout); wmKeyMap *km; /* We want to know if this op has a shortcut, be it hotkey or not. */ |