Revision: 23262 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23262 Author: elubie Date: 2009-09-15 22:47:34 +0200 (Tue, 15 Sep 2009)
Log Message: ----------- 2.5 filebrowser bugfix #1: SpaceFile->files needs to be deleted on exec and cancel of the filebrowser and in init to ensure correct setting of the read function. bugfix #2: SpaceFile->params needs to be set in file_init otherwise Python can't access params in header ui. Modified Paths: -------------- trunk/blender/source/blender/editors/space_file/file_ops.c trunk/blender/source/blender/editors/space_file/filesel.c trunk/blender/source/blender/editors/space_file/space_file.c Modified: trunk/blender/source/blender/editors/space_file/file_ops.c =================================================================== --- trunk/blender/source/blender/editors/space_file/file_ops.c 2009-09-15 19:53:18 UTC (rev 23261) +++ trunk/blender/source/blender/editors/space_file/file_ops.c 2009-09-15 20:47:34 UTC (rev 23262) @@ -496,6 +496,12 @@ WM_event_fileselect_event(C, sfile->op, EVT_FILESELECT_CANCEL); sfile->op = NULL; + if (sfile->files) { + filelist_free(sfile->files); + MEM_freeN(sfile->files); + sfile->files= NULL; + } + return OPERATOR_FINISHED; } @@ -567,6 +573,10 @@ BLI_make_file_string(G.sce, name, BLI_gethome(), ".Bfs"); fsmenu_write_file(fsmenu_get(), name); WM_event_fileselect_event(C, op, EVT_FILESELECT_EXEC); + + filelist_free(sfile->files); + MEM_freeN(sfile->files); + sfile->files= NULL; } return OPERATOR_FINISHED; Modified: trunk/blender/source/blender/editors/space_file/filesel.c =================================================================== --- trunk/blender/source/blender/editors/space_file/filesel.c 2009-09-15 19:53:18 UTC (rev 23261) +++ trunk/blender/source/blender/editors/space_file/filesel.c 2009-09-15 20:47:34 UTC (rev 23262) @@ -169,18 +169,13 @@ } else { /* default values, if no operator */ + params->type = FILE_UNIX; params->flag |= FILE_HIDE_DOT; params->display = FILE_SHORTDISPLAY; params->filter = 0; params->sort = FILE_SORT_ALPHA; } - /* new params, refresh file list */ - if(sfile->files) { - filelist_free(sfile->files); - filelist_setdir(sfile->files, params->dir); - } - return 1; } Modified: trunk/blender/source/blender/editors/space_file/space_file.c =================================================================== --- trunk/blender/source/blender/editors/space_file/space_file.c 2009-09-15 19:53:18 UTC (rev 23261) +++ trunk/blender/source/blender/editors/space_file/space_file.c 2009-09-15 20:47:34 UTC (rev 23262) @@ -159,6 +159,12 @@ if(sfile->params) { MEM_freeN(sfile->params); sfile->params = 0; + ED_fileselect_set_params(sfile); + if (sfile->files) { + filelist_free(sfile->files); + MEM_freeN(sfile->files); + sfile->files= NULL; + } } printf("file_init\n"); } _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs