[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34293] trunk/blender/source/blender/ editors/space_file/file_ops.c: small feature for file manager, pasting a full file path into the directory field will split the dir/file.

Campbell Barton ideasman42 at gmail.com
Thu Jan 13 08:25:19 CET 2011


Revision: 34293
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=34293
Author:   campbellbarton
Date:     2011-01-13 07:25:18 +0000 (Thu, 13 Jan 2011)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_file/file_ops.c

Modified: trunk/blender/source/blender/editors/space_file/file_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_file/file_ops.c	2011-01-13 06:14:14 UTC (rev 34292)
+++ trunk/blender/source/blender/editors/space_file/file_ops.c	2011-01-13 07:25:18 UTC (rev 34293)
@@ -1056,8 +1056,15 @@
 
 		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);
 		file_change_dir(C, 1);




More information about the Bf-blender-cvs mailing list