diff options
author | Andrea Weikert <elubie@gmx.net> | 2009-09-13 12:08:50 +0400 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2009-09-13 12:08:50 +0400 |
commit | 7eea0b647cbfa7cadec14b07b696bf10830189e8 (patch) | |
tree | b6772d15261e8de671efe5c04fbfc62b66718cb7 | |
parent | b1e418db20cb854a933f0dcf9689a9104b99be7d (diff) |
2.5 filebrowser
Fix crash when loading old files with filebrowser UI
Partial Fix for invoking filebrowser via spacetype pupmenu: reset directory in filelist
Make paths relative in 'path' return when requested by 'relative_paths' property in operator
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_file/filesel.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_file/space_file.c | 3 |
3 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 5d3c2c766a3..e51fd421c8c 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -524,6 +524,10 @@ int file_exec(bContext *C, wmOperator *unused) BLI_strncpy(name, sfile->params->dir, sizeof(name)); RNA_string_set(op->ptr, "directory", name); strcat(name, sfile->params->file); + + if ( RNA_boolean_get(op->ptr, "relative_paths") ) { + BLI_makestringcode(G.sce, name); + } RNA_string_set(op->ptr, "path", name); /* some ops have multiple files to select */ diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index e22e9f8e023..f226b3de260 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -117,6 +117,8 @@ short ED_fileselect_set_params(SpaceFile *sfile) BLI_strncpy(sfile->params->file, file, sizeof(sfile->params->file)); BLI_make_file_string(G.sce, sfile->params->dir, dir, ""); /* XXX needed ? - also solve G.sce */ } + + ED_fileselect_reset_params(sfile); params = sfile->params; @@ -173,13 +175,17 @@ short ED_fileselect_set_params(SpaceFile *sfile) } /* new params, refresh file list */ - if(sfile->files) filelist_free(sfile->files); + if(sfile->files) { + filelist_free(sfile->files); + filelist_setdir(sfile->files, params->dir); + } return 1; } void ED_fileselect_reset_params(SpaceFile *sfile) { + sfile->params->type = FILE_UNIX; sfile->params->flag = 0; sfile->params->title[0] = '\0'; } diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index f71defe3949..bceeec1cb55 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -166,7 +166,8 @@ static SpaceLink *file_duplicate(SpaceLink *sl) /* clear or remove stuff from old */ sfilen->op = NULL; /* file window doesn't own operators */ - sfilen->files = filelist_new(sfileo->params->type); + if (sfileo->params) + sfilen->files = filelist_new(sfileo->params->type); if(sfileo->folders_prev) sfilen->folders_prev = MEM_dupallocN(sfileo->folders_prev); |