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-07-10 23:19:54 +0400
committerAndrea Weikert <elubie@gmx.net>2009-07-10 23:19:54 +0400
commitac11d522c8cad7eeabe07e643effbc776e933728 (patch)
tree32809399cfb65a5a4f002b883736932cb9f1baa9 /source/blender/editors/space_file/file_ops.c
parenta74edc0caf2380bd92aa812835a1b5f922f2ca56 (diff)
2.5 filebrowser
* bugfix: don't allow parent dir to go beyond root * bugfix: only attempt to change directory if it exists New (WIP) feature: autocomplete for directory * works on TAB * so far only one level (in current directory)
Diffstat (limited to 'source/blender/editors/space_file/file_ops.c')
-rw-r--r--source/blender/editors/space_file/file_ops.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index ef15586bba9..585e042ae8a 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -142,10 +142,10 @@ static void file_select(SpaceFile* sfile, ARegion* ar, const rcti* rect, short v
{
// XXX error("Path too long, cannot enter this directory");
} else {
+ BLI_cleanup_dir(G.sce, params->dir);
strcat(params->dir, file->relname);
- strcat(params->dir,"/");
+ BLI_add_slash(params->dir);
params->file[0] = '\0';
- BLI_cleanup_dir(G.sce, params->dir);
file_change_dir(sfile);
}
}
@@ -557,11 +557,13 @@ int file_parent_exec(bContext *C, wmOperator *unused)
SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C);
if(sfile->params) {
- BLI_parent_dir(sfile->params->dir);
- file_change_dir(sfile);
+ if (BLI_has_parent(sfile->params->dir)) {
+ BLI_parent_dir(sfile->params->dir);
+ file_change_dir(sfile);
+ WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL);
+ }
}
- WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL);
-
+
return OPERATOR_FINISHED;
}
@@ -718,10 +720,11 @@ int file_directory_exec(bContext *C, wmOperator *unused)
BLI_strncpy(sfile->params->dir, tmpstr, sizeof(sfile->params->dir));
}
}
-
+ BLI_add_slash(sfile->params->dir);
file_change_dir(sfile);
+ WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL);
}
- WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL);
+
return OPERATOR_FINISHED;
}