diff options
author | Hans Goudey <h.goudey@me.com> | 2020-06-02 21:09:01 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-06-02 21:09:01 +0300 |
commit | 071cc71fb066dd39569e9c8c90ab7aed8d7b0eda (patch) | |
tree | f82dddfea984f8022dd2c0cc885213a1464629a4 /source/blender/editors/interface | |
parent | dcdbcf1ec1f537de0984da018c7da50211a3f81c (diff) |
Cleanup: Use const context for some UI templates
- uiTemplateID: Straightforward, just const for the template
and the functions it calls
- uiTemplateCacheFile: Create a function in rna_ui.c because
the generated RNA callback doesn't have const context.
Differential Revision: https://developer.blender.org/D7895
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 9b59e4419c4..6bf2c721c20 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -799,7 +799,7 @@ static uiBut *template_id_def_new_but(uiBlock *block, return but; } -static void template_ID(bContext *C, +static void template_ID(const bContext *C, uiLayout *layout, TemplateID *template_ui, StructRNA *type, @@ -1140,7 +1140,7 @@ ID *UI_context_active_but_get_tab_ID(bContext *C) } } -static void template_ID_tabs(bContext *C, +static void template_ID_tabs(const bContext *C, uiLayout *layout, TemplateID *template, StructRNA *type, @@ -1214,7 +1214,7 @@ static void template_ID_tabs(bContext *C, } static void ui_template_id(uiLayout *layout, - bContext *C, + const bContext *C, PointerRNA *ptr, const char *propname, const char *newop, @@ -1298,7 +1298,7 @@ static void ui_template_id(uiLayout *layout, } void uiTemplateID(uiLayout *layout, - bContext *C, + const bContext *C, PointerRNA *ptr, const char *propname, const char *newop, @@ -7523,7 +7523,10 @@ void uiTemplateNodeSocket(uiLayout *layout, bContext *UNUSED(C), float *color) /** \name Cache File Template * \{ */ -void uiTemplateCacheFile(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname) +void uiTemplateCacheFile(uiLayout *layout, + const bContext *C, + PointerRNA *ptr, + const char *propname) { if (!ptr->data) { return; |