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:
authorJulian Eisel <eiseljulian@gmail.com>2015-07-11 06:20:35 +0300
committerJulian Eisel <eiseljulian@gmail.com>2015-07-11 06:48:02 +0300
commit02b36188737b3e15fe8173dec7a57da7da610922 (patch)
treea3ce6d9dd7e98910c939b2ff88ed5baa412e035d /source/blender/editors/space_file/filesel.c
parent909fa34c5f8cea52ce5fa469315936c6303f41b1 (diff)
File Browser: Keep file name after changing directory
Actually this was an intentional change in rBaeeb23efa28dc to prevent Blender from trying to open the old file from the new directory. Issue is that this is really bad for saving and basically breaks "Save As". Some more tweaks were needed to make it work like before, so now it keeps the name of the last selected file, but clears it when selecting a folder.
Diffstat (limited to 'source/blender/editors/space_file/filesel.c')
-rw-r--r--source/blender/editors/space_file/filesel.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index ef29b720eed..21db41b27a5 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -293,7 +293,7 @@ void ED_fileselect_reset_params(SpaceFile *sfile)
void fileselect_file_set(SpaceFile *sfile, const int index)
{
const struct direntry *file = filelist_file(sfile->files, index);
- if (file && file->relname[0] && !FILENAME_IS_PARENT(file->relname)) {
+ if (file && file->relname[0] && file->path && !BLI_is_dir(file->path)) {
BLI_strncpy(sfile->params->file, file->relname, FILE_MAXFILE);
}
}
@@ -588,16 +588,14 @@ void ED_file_change_dir(bContext *C, const bool checkdir)
/* Clear search string, it is very rare to want to keep that filter while changing dir,
* and usually very annoying to keep it actually! */
sfile->params->filter_search[0] = '\0';
+ sfile->params->active_file = -1;
if (checkdir && !BLI_is_dir(sfile->params->dir)) {
BLI_strncpy(sfile->params->dir, filelist_dir(sfile->files), sizeof(sfile->params->dir));
/* could return but just refresh the current dir */
}
filelist_setdir(sfile->files, sfile->params->dir);
- /* clear selected file to avoid trying to open it from the new dir with changed path */
- sfile->params->file[0] = '\0';
- sfile->params->active_file = -1;
-
+
if (folderlist_clear_next(sfile))
folderlist_free(sfile->folders_next);