diff options
Diffstat (limited to 'source/blender/editors/space_file/filesel.c')
-rw-r--r-- | source/blender/editors/space_file/filesel.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 1fa89e5db9a..778a3f4df3e 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -94,6 +94,9 @@ FileSelectParams *ED_fileselect_get_params(struct SpaceFile *sfile) return sfile->params; } +/** + * \note RNA_struct_property_is_set_ex is used here because we wan't + * the previously used settings to be used here rather then overriding them */ short ED_fileselect_set_params(SpaceFile *sfile) { FileSelectParams *params; @@ -124,7 +127,7 @@ short ED_fileselect_set_params(SpaceFile *sfile) else params->type = FILE_SPECIAL; - if (is_filepath && RNA_struct_property_is_set(op->ptr, "filepath")) { + if (is_filepath && RNA_struct_property_is_set_ex(op->ptr, "filepath", FALSE)) { char name[FILE_MAX]; RNA_string_get(op->ptr, "filepath", name); if (params->type == FILE_LOADLIB) { @@ -136,12 +139,12 @@ short ED_fileselect_set_params(SpaceFile *sfile) } } else { - if (is_directory && RNA_struct_property_is_set(op->ptr, "directory")) { + if (is_directory && RNA_struct_property_is_set_ex(op->ptr, "directory", FALSE)) { RNA_string_get(op->ptr, "directory", params->dir); sfile->params->file[0] = '\0'; } - if (is_filename && RNA_struct_property_is_set(op->ptr, "filename")) { + if (is_filename && RNA_struct_property_is_set_ex(op->ptr, "filename", FALSE)) { RNA_string_get(op->ptr, "filename", params->file); } } @@ -161,12 +164,12 @@ short ED_fileselect_set_params(SpaceFile *sfile) params->filter = 0; if (RNA_struct_find_property(op->ptr, "filter_blender")) params->filter |= RNA_boolean_get(op->ptr, "filter_blender") ? BLENDERFILE : 0; + if (RNA_struct_find_property(op->ptr, "filter_backup")) + params->filter |= RNA_boolean_get(op->ptr, "filter_backup") ? BLENDERFILE_BACKUP : 0; if (RNA_struct_find_property(op->ptr, "filter_image")) params->filter |= RNA_boolean_get(op->ptr, "filter_image") ? IMAGEFILE : 0; if (RNA_struct_find_property(op->ptr, "filter_movie")) params->filter |= RNA_boolean_get(op->ptr, "filter_movie") ? MOVIEFILE : 0; - if (RNA_struct_find_property(op->ptr, "filter_text")) - params->filter |= RNA_boolean_get(op->ptr, "filter_text") ? TEXTFILE : 0; if (RNA_struct_find_property(op->ptr, "filter_python")) params->filter |= RNA_boolean_get(op->ptr, "filter_python") ? PYSCRIPTFILE : 0; if (RNA_struct_find_property(op->ptr, "filter_font")) @@ -228,7 +231,7 @@ short ED_fileselect_set_params(SpaceFile *sfile) } if (is_relative_path) { - if (!RNA_struct_property_is_set(op->ptr, "relative_path")) { + if (!RNA_struct_property_is_set_ex(op->ptr, "relative_path", FALSE)) { RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); } } @@ -307,7 +310,7 @@ FileSelection ED_fileselect_layout_offset_rect(FileLayout *layout, const rcti *r CLAMP(rowmin, 0, layout->rows - 1); CLAMP(colmax, 0, layout->columns - 1); CLAMP(rowmax, 0, layout->rows - 1); - } + } if ((colmin > layout->columns - 1) || (rowmin > layout->rows - 1)) { sel.first = -1; |