diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-07-11 09:07:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-07-11 09:07:55 +0400 |
commit | d419e2e90cc3bb3fd6aa89baab8b4f4caa2001e1 (patch) | |
tree | be24f0e46feb17e37569f260c21dad4561a91a5b /source/blender/editors/space_file/file_ops.c | |
parent | dd9a33dc83f912c89947a149a76e374ee3bba13e (diff) |
WM: add WM_operator_properties_create_ptr
Call operator types directly and avoid a lookup when their known.
Diffstat (limited to 'source/blender/editors/space_file/file_ops.c')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 1d3013bd8b4..27d6fabba4e 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -1277,8 +1277,9 @@ void file_directory_enter_handle(bContext *C, void *UNUSED(arg_unused), void *UN const char *lastdir = folderlist_peeklastdir(sfile->folders_prev); /* if not, ask to create it and enter if confirmed */ + wmOperatorType *ot = WM_operatortype_find("FILE_OT_directory_new", false); PointerRNA ptr; - WM_operator_properties_create(&ptr, "FILE_OT_directory_new"); + WM_operator_properties_create_ptr(&ptr, ot); RNA_string_set(&ptr, "directory", sfile->params->dir); RNA_boolean_set(&ptr, "open", true); @@ -1286,7 +1287,7 @@ void file_directory_enter_handle(bContext *C, void *UNUSED(arg_unused), void *UN BLI_strncpy(sfile->params->dir, lastdir, sizeof(sfile->params->dir)); - WM_operator_name_call(C, "FILE_OT_directory_new", WM_OP_INVOKE_DEFAULT, &ptr); + WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &ptr); WM_operator_properties_free(&ptr); } |