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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-06-05 14:27:41 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-06-05 14:27:41 +0300
commit8db6b1e2ddf342a5cf6bf1f42359ccbfee1ab958 (patch)
tree3fc34c2a76cc3d82492415619be85e03a22ea1e8 /source/blender
parenteda377c223cfc0460e3294c95771313f8d4388c3 (diff)
Fix empty name shown for operators opening menus without a title
For some cases like the edit mode context menu we don't currently have a fixed title since it's dynamic. This should be improved, but we should at least still show Call Menu if there is no menu title.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/windowmanager/intern/wm_operator_type.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_operator_type.c b/source/blender/windowmanager/intern/wm_operator_type.c
index 1cec9848104..5c9093168bd 100644
--- a/source/blender/windowmanager/intern/wm_operator_type.c
+++ b/source/blender/windowmanager/intern/wm_operator_type.c
@@ -586,12 +586,13 @@ static void wm_operatortype_free_macro(wmOperatorType *ot)
const char *WM_operatortype_name(struct wmOperatorType *ot, struct PointerRNA *properties)
{
+ const char *name = NULL;
+
if (ot->get_name && properties) {
- return ot->get_name(ot, properties);
- }
- else {
- return RNA_struct_ui_name(ot->srna);
+ name = ot->get_name(ot, properties);
}
+
+ return (name && name[0]) ? name : RNA_struct_ui_name(ot->srna);
}
/** \} */