Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-01-13 10:25:18 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-01-13 10:25:18 +0300
commitf373dd6a506223a611ae50c7a8b4b16d7c9ad19d (patch)
treeb50066c276ac24b18563d9570b80cc9cfa853a01 /source
parent4b922c0bf3c095087a7ee40fa6fe7056bbc6b537 (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')
-rw-r--r--source/blender/editors/space_file/file_ops.c9
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);