diff options
author | Andrea Weikert <elubie@gmx.net> | 2009-09-20 22:26:02 +0400 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2009-09-20 22:26:02 +0400 |
commit | 3b4410367f1011f91cd91022b17c59917bf3ee34 (patch) | |
tree | 519b3535eb808f6fa4b214b533b8ad5beae6bc57 /source | |
parent | 189263e1d9cd1cfdb2e9a96a01761858e8deaa7c (diff) |
2.5 filebrowser
more bugfixes:
* removed refreshing code at file_init again, causes issues when resizing
* free library in the filelist after use
* make sure directory exists when library file for append/link doesn't exist, so browsing can continue from valid dir.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_file/space_file.c | 11 |
3 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 16c8733cb5b..70d8de7d509 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -518,6 +518,7 @@ int file_cancel_exec(bContext *C, wmOperator *unused) sfile->op = NULL; if (sfile->files) { + filelist_freelib(sfile->files); filelist_free(sfile->files); MEM_freeN(sfile->files); sfile->files= NULL; @@ -606,6 +607,7 @@ int file_exec(bContext *C, wmOperator *unused) fsmenu_write_file(fsmenu_get(), name); WM_event_fileselect_event(C, op, EVT_FILESELECT_EXEC); + filelist_freelib(sfile->files); filelist_free(sfile->files); MEM_freeN(sfile->files); sfile->files= NULL; diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 582a5997ef5..8257aa5482f 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -804,6 +804,8 @@ static void filelist_read_library(struct FileList* filelist) if(!filelist->libfiledata) { int num; struct direntry *file; + + BLI_make_exist(filelist->dir); filelist_read_dir(filelist); file = filelist->filelist; for(num=0; num<filelist->numfiles; num++, file++) { diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 99d649b28cc..56dbdcbc645 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -156,16 +156,6 @@ static void file_free(SpaceLink *sl) static void file_init(struct wmWindowManager *wm, ScrArea *sa) { SpaceFile *sfile= (SpaceFile*)sa->spacedata.first; - 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"); } @@ -213,6 +203,7 @@ static void file_refresh(const bContext *C, ScrArea *sa) if (filelist_empty(sfile->files)) { filelist_readdir(sfile->files); + BLI_strncpy(params->dir, filelist_dir(sfile->files), FILE_MAX); } if(params->sort!=FILE_SORT_NONE) filelist_sort(sfile->files, params->sort); |