diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-13 10:25:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-13 10:25:18 +0300 |
commit | f373dd6a506223a611ae50c7a8b4b16d7c9ad19d (patch) | |
tree | b50066c276ac24b18563d9570b80cc9cfa853a01 /source/blender/editors/space_file | |
parent | 4b922c0bf3c095087a7ee40fa6fe7056bbc6b537 (diff) |
small feature for file manager, pasting a full file path into the directory field will split the dir/file.
nice when you have a list of file paths in a terminal/editor and want to open one.
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index dc550d84e4d..55dc19d9bb9 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -1056,7 +1056,14 @@ int file_directory_exec(bContext *C, wmOperator *UNUSED(unused)) if (!BLI_exists(sfile->params->dir)) { BLI_recurdir_fileops(sfile->params->dir); - } + } + + /* special case, user may have pasted a fulepath into the directory */ + if(BLI_exists(sfile->params->dir) && BLI_is_dir(sfile->params->dir) == 0) { + char path[sizeof(sfile->params->dir)]; + BLI_strncpy(path, sfile->params->dir, sizeof(path)); + BLI_split_dirfile(path, sfile->params->dir, sfile->params->file); + } BLI_cleanup_dir(G.main->name, sfile->params->dir); BLI_add_slash(sfile->params->dir); |