diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-17 19:11:12 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-17 19:11:12 +0400 |
commit | 6717b75ecdd7d9702b280dc3fccccc172e261d38 (patch) | |
tree | da566cc4db87325bfb8b349d414f3c0a62489805 /source/blender/editors/space_file | |
parent | 84dc5a3b94d033466692f6c878c6cb9054114fdc (diff) |
bugfix [#23783] /../ prefix stops going up a dir
also fix for recent addition to operator check(), when the file selector is loaded with no operator.
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index c3e9e22eaad..9393f1c4d6d 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -624,28 +624,32 @@ void file_draw_check_cb(bContext *C, void *dummy1, void *dummy2) { SpaceFile *sfile= CTX_wm_space_file(C); wmOperator *op= sfile->op; - if(op->type->check) { - char filepath[FILE_MAX]; - file_sfile_to_operator(op, sfile, filepath); - - /* redraw */ - if(op->type->check(C, op)) { - file_operator_to_sfile(sfile, op); - - /* redraw, else the changed settings wont get updated */ - ED_area_tag_redraw(CTX_wm_area(C)); + if(op) { /* fail on reload */ + if(op->type->check) { + char filepath[FILE_MAX]; + file_sfile_to_operator(op, sfile, filepath); + + /* redraw */ + if(op->type->check(C, op)) { + file_operator_to_sfile(sfile, op); + + /* redraw, else the changed settings wont get updated */ + ED_area_tag_redraw(CTX_wm_area(C)); + } } } } int file_draw_check_exists(SpaceFile *sfile) { - if(RNA_struct_find_property(sfile->op->ptr, "check_existing")) { - if(RNA_boolean_get(sfile->op->ptr, "check_existing")) { - char filepath[FILE_MAX]; - BLI_join_dirfile(filepath, sfile->params->dir, sfile->params->file); - if(BLI_exists(filepath) && !BLI_is_dir(filepath)) { - return TRUE; + if(sfile->op) { /* fails on reload */ + if(RNA_struct_find_property(sfile->op->ptr, "check_existing")) { + if(RNA_boolean_get(sfile->op->ptr, "check_existing")) { + char filepath[FILE_MAX]; + BLI_join_dirfile(filepath, sfile->params->dir, sfile->params->file); + if(BLI_exists(filepath) && !BLI_is_dir(filepath)) { + return TRUE; + } } } } |