Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Weikert <elubie@gmx.net>2009-09-13 13:41:00 +0400
committerAndrea Weikert <elubie@gmx.net>2009-09-13 13:41:00 +0400
commit78bb6ce0347234d9103453d1242ec8e397d3eb7f (patch)
tree54d22a5f8b75286a78ee3f153263d910cbd10ddf /source/blender/editors/space_file/space_file.c
parentf9694287d9a9a2ca5d031d6fbf4aa05045944ecc (diff)
2.5 filebrowser
* Fix for space init when loading with pupmenu (without operator) - parameters now get reset * experimental: made new director operator jump directly into renaming
Diffstat (limited to 'source/blender/editors/space_file/space_file.c')
-rw-r--r--source/blender/editors/space_file/space_file.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index bceeec1cb55..47839ea0342 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -45,6 +45,7 @@
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
#include "BLI_rand.h"
+#include "BLI_storage_types.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
@@ -154,6 +155,9 @@ static void file_free(SpaceLink *sl)
/* spacetype; init callback, area size changes, screen set, etc */
static void file_init(struct wmWindowManager *wm, ScrArea *sa)
{
+ SpaceFile *sfile= (SpaceFile*)sa->spacedata.first;
+ MEM_freeN(sfile->params);
+ sfile->params = 0;
printf("file_init\n");
}
@@ -203,7 +207,17 @@ static void file_refresh(const bContext *C, ScrArea *sa)
filelist_readdir(sfile->files);
}
if(params->sort!=FILE_SORT_NONE) filelist_sort(sfile->files, params->sort);
-
+
+ if (params->renamefile[0] != '\0') {
+ int idx = filelist_find(sfile->files, params->renamefile);
+ if (idx >= 0) {
+ struct direntry *file= filelist_file(sfile->files, idx);
+ if (file) {
+ file->flags |= EDITING;
+ }
+ }
+ params->renamefile[0] = '\0';
+ }
if (sfile->layout) sfile->layout->dirty= 1;
}