Revision: 31203
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31203
Author:   dfelinto
Date:     2010-08-10 00:54:40 +0200 (Tue, 10 Aug 2010)

Log Message:
-----------
Bugfix for:[23234] Blender File Browser - Back Button does work with first 
directory entered?

For !WIN32 systems the fix was in ED_fileselect_set_params
(basically adding the first folder in the sfile->folders_prev list)

For WIN32:
I talked with Nathan (Jesterking) and he agreed that the fix in path_util.c was 
required too. Without that BLI_path_abs was always making WIN32 paths ending 
with \ to end with \\
(e.g. C:\Blender\ --> C:\Blender\\)
And this was making the folder to fail ISDIR tests.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/intern/path_util.c
    trunk/blender/source/blender/editors/space_file/filesel.c

Modified: trunk/blender/source/blender/blenlib/intern/path_util.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/path_util.c     2010-08-09 
22:21:22 UTC (rev 31202)
+++ trunk/blender/source/blender/blenlib/intern/path_util.c     2010-08-09 
22:54:40 UTC (rev 31203)
@@ -637,6 +637,8 @@
        
        if (path[0]!='\0') {
                if ( path[strlen(path)-1]=='/') {
+                       /* remove the '/' so we avoid BLI_cleanup_dir adding an 
extra \ in WIN32 */
+                       path[strlen(path)-1] = '\0';
                        BLI_cleanup_dir(NULL, path);
                } else {
                        BLI_cleanup_file(NULL, path);

Modified: trunk/blender/source/blender/editors/space_file/filesel.c
===================================================================
--- trunk/blender/source/blender/editors/space_file/filesel.c   2010-08-09 
22:21:22 UTC (rev 31202)
+++ trunk/blender/source/blender/editors/space_file/filesel.c   2010-08-09 
22:54:40 UTC (rev 31203)
@@ -206,6 +206,13 @@
                params->filter = 0;
                params->sort = FILE_SORT_ALPHA;
        }
+
+
+       /* initialize the list with previous folders */
+       if (!sfile->folders_prev)
+               sfile->folders_prev = folderlist_new();
+       folderlist_pushdir(sfile->folders_prev, sfile->params->dir);
+
        return 1;
 }
 


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to