diff options
-rw-r--r-- | source/blender/editors/space_file/filesel.c | 15 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_add.c | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 3dbfdc9f7d0..6773dfb6b2d 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -121,8 +121,10 @@ short ED_fileselect_set_params(SpaceFile *sfile) /* set the parameters from the operator, if it exists */ if (op) { - short is_filename= FALSE; - short is_dir= FALSE; + const short is_files= (RNA_struct_find_property(op->ptr, "files") != NULL); + const short is_filepath= (RNA_struct_find_property(op->ptr, "filepath") != NULL); + const short is_filename= (RNA_struct_find_property(op->ptr, "filename") != NULL); + const short is_directory= (RNA_struct_find_property(op->ptr, "directory") != NULL); BLI_strncpy(params->title, op->type->name, sizeof(params->title)); @@ -131,7 +133,7 @@ short ED_fileselect_set_params(SpaceFile *sfile) else params->type = FILE_SPECIAL; - if ((is_dir= is_filename= RNA_struct_find_property(op->ptr, "filepath")!=NULL) && RNA_property_is_set(op->ptr, "filepath")) { + if (is_filepath && RNA_property_is_set(op->ptr, "filepath")) { char name[FILE_MAX]; RNA_string_get(op->ptr, "filepath", name); if (params->type == FILE_LOADLIB) { @@ -143,13 +145,12 @@ short ED_fileselect_set_params(SpaceFile *sfile) } } else { - if ((is_dir= RNA_struct_find_property(op->ptr, "directory")!=NULL) && RNA_property_is_set(op->ptr, "directory")) { + if (is_directory && RNA_property_is_set(op->ptr, "directory")) { RNA_string_get(op->ptr, "directory", params->dir); sfile->params->file[0]= '\0'; - is_dir= TRUE; } - if ((is_filename= RNA_struct_find_property(op->ptr, "filename")!=NULL) && RNA_property_is_set(op->ptr, "filename")) { + if (is_filename && RNA_property_is_set(op->ptr, "filename")) { RNA_string_get(op->ptr, "filename", params->file); } } @@ -159,7 +160,7 @@ short ED_fileselect_set_params(SpaceFile *sfile) BLI_path_abs(params->dir, G.main->name); } - if(is_dir==TRUE && is_filename==FALSE) { + if(is_directory==TRUE && is_filename==FALSE && is_filepath==FALSE && is_files==FALSE) { params->flag |= FILE_DIRSEL_ONLY; } else { diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index e4c3555eac1..067d63b3b6c 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -551,7 +551,7 @@ void SEQUENCER_OT_image_strip_add(struct wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_DIRECTORY|WM_FILESEL_FILENAME|WM_FILESEL_RELPATH); + WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_DIRECTORY|WM_FILESEL_RELPATH); sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_ENDFRAME|SEQPROP_FILES); } |