diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-07-03 18:30:31 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-07-03 18:42:46 +0300 |
commit | 33a74941c5fd4efb6eefcaace3315d3e2b65681f (patch) | |
tree | 2d3da68b73e4419750c7f767bbb78bf1a303ad18 /source/blender/editors/space_buttons/buttons_ops.c | |
parent | 367034f210137754ab4f07a0e7793066d2b69e59 (diff) |
Cleanup: Editors, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors` module.
No functional changes.
Diffstat (limited to 'source/blender/editors/space_buttons/buttons_ops.c')
-rw-r--r-- | source/blender/editors/space_buttons/buttons_ops.c | 67 |
1 files changed, 33 insertions, 34 deletions
diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 53a904438eb..733f344fbc6 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -208,45 +208,44 @@ static int file_browse_invoke(bContext *C, wmOperator *op, const wmEvent *event) MEM_freeN(str); return OPERATOR_CANCELLED; } - else { - PropertyRNA *prop_relpath; - const char *path_prop = RNA_struct_find_property(op->ptr, "directory") ? "directory" : - "filepath"; - fbo = MEM_callocN(sizeof(FileBrowseOp), "FileBrowseOp"); - fbo->ptr = ptr; - fbo->prop = prop; - fbo->is_undo = is_undo; - fbo->is_userdef = is_userdef; - op->customdata = fbo; - - /* normally ED_fileselect_get_params would handle this but we need to because of stupid - * user-prefs exception - campbell */ - if ((prop_relpath = RNA_struct_find_property(op->ptr, "relative_path"))) { - if (!RNA_property_is_set(op->ptr, prop_relpath)) { - bool is_relative = (U.flag & USER_RELPATHS) != 0; - - /* while we want to follow the defaults, - * we better not switch existing paths relative/absolute state. */ - if (str[0]) { - is_relative = BLI_path_is_rel(str); - } - - if (UNLIKELY(ptr.data == &U)) { - is_relative = false; - } - - /* annoying exception!, if we're dealing with the user prefs, default relative to be off */ - RNA_property_boolean_set(op->ptr, prop_relpath, is_relative); + + PropertyRNA *prop_relpath; + const char *path_prop = RNA_struct_find_property(op->ptr, "directory") ? "directory" : + "filepath"; + fbo = MEM_callocN(sizeof(FileBrowseOp), "FileBrowseOp"); + fbo->ptr = ptr; + fbo->prop = prop; + fbo->is_undo = is_undo; + fbo->is_userdef = is_userdef; + op->customdata = fbo; + + /* normally ED_fileselect_get_params would handle this but we need to because of stupid + * user-prefs exception - campbell */ + if ((prop_relpath = RNA_struct_find_property(op->ptr, "relative_path"))) { + if (!RNA_property_is_set(op->ptr, prop_relpath)) { + bool is_relative = (U.flag & USER_RELPATHS) != 0; + + /* while we want to follow the defaults, + * we better not switch existing paths relative/absolute state. */ + if (str[0]) { + is_relative = BLI_path_is_rel(str); + } + + if (UNLIKELY(ptr.data == &U)) { + is_relative = false; } + + /* annoying exception!, if we're dealing with the user prefs, default relative to be off */ + RNA_property_boolean_set(op->ptr, prop_relpath, is_relative); } + } - RNA_string_set(op->ptr, path_prop, str); - MEM_freeN(str); + RNA_string_set(op->ptr, path_prop, str); + MEM_freeN(str); - WM_event_add_fileselect(C, op); + WM_event_add_fileselect(C, op); - return OPERATOR_RUNNING_MODAL; - } + return OPERATOR_RUNNING_MODAL; } void BUTTONS_OT_file_browse(wmOperatorType *ot) |