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>2010-03-15 23:28:13 +0300
committerAndrea Weikert <elubie@gmx.net>2010-03-15 23:28:13 +0300
commit8fdb4d45063f01be975cf3c6351607115a0b8d4e (patch)
treed23e627f659b2718de89f442c167b37e838a26d6 /source/blender/editors
parentae6ee27d37f94a5c26cdf6060d71c5b6bc209a0e (diff)
Fix [#21618] Wrong Icon For BLEND file on File/Append
While the folder icon was originally planned when in append/link mode, it's easier to distinguish with a blender icon, so the folder icon is now replaced. Also fixed issue introduced in rev. 27491 where filter settings were incorrectly set when moving out of .blend file again.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_file/file_draw.c3
-rw-r--r--source/blender/editors/space_file/filelist.c20
-rw-r--r--source/blender/editors/space_file/filesel.c5
-rw-r--r--source/blender/editors/space_file/space_file.c4
4 files changed, 21 insertions, 11 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index a2b4dcbac60..63729f03e58 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -298,6 +298,9 @@ static int get_file_icon(struct direntry *file)
if ( strcmp(file->relname, "..") == 0) {
return ICON_FILE_PARENT;
}
+ if(file->flags & BLENDERFILE) {
+ return ICON_FILE_BLEND;
+ }
return ICON_FILE_FOLDER;
}
else if (file->flags & BLENDERFILE)
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index b90bb47e6ce..c11260d7179 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -627,13 +627,13 @@ struct ImBuf * filelist_geticon(struct FileList* filelist, int index)
fidx = filelist->fidx[index];
file = &filelist->filelist[fidx];
if (file->type & S_IFDIR) {
- if ( strcmp(filelist->filelist[fidx].relname, "..") == 0) {
- ibuf = gSpecialFileImages[SPECIAL_IMG_PARENT];
- } else if ( strcmp(filelist->filelist[fidx].relname, ".") == 0) {
- ibuf = gSpecialFileImages[SPECIAL_IMG_REFRESH];
- } else {
- ibuf = gSpecialFileImages[SPECIAL_IMG_FOLDER];
- }
+ if ( strcmp(filelist->filelist[fidx].relname, "..") == 0) {
+ ibuf = gSpecialFileImages[SPECIAL_IMG_PARENT];
+ } else if ( strcmp(filelist->filelist[fidx].relname, ".") == 0) {
+ ibuf = gSpecialFileImages[SPECIAL_IMG_REFRESH];
+ } else {
+ ibuf = gSpecialFileImages[SPECIAL_IMG_FOLDER];
+ }
} else {
ibuf = gSpecialFileImages[SPECIAL_IMG_UNKNOWNFILE];
}
@@ -788,8 +788,12 @@ void filelist_setfiletypes(struct FileList* filelist, short has_quicktime)
file->type= file->s.st_mode; /* restore the mess below */
/* Don't check extensions for directories */
- if (file->type & S_IFDIR)
+ if (file->type & S_IFDIR) {
+ if(BLO_has_bfile_extension(file->relname)) {
+ file->flags |= BLENDERFILE;
+ }
continue;
+ }
if(BLO_has_bfile_extension(file->relname)) {
file->flags |= BLENDERFILE;
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index 758740e676a..6945e8c959a 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -194,7 +194,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
params->filter = 0;
params->sort = FILE_SORT_ALPHA;
}
-
+ params->oldflag = params->flag;
return 1;
}
@@ -414,6 +414,9 @@ void file_change_dir(bContext *C, int checkdir)
char dir[FILE_MAX];
if (filelist_islibrary(sfile->files, dir, group)) {
sfile->params->flag &= ~FILE_FILTER;
+ } else {
+ /* reset the old flag */
+ sfile->params->flag = sfile->params->oldflag;
}
}
if(folderlist_clear_next(sfile))
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index 105ece8e95f..141d4f63f1c 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -140,8 +140,6 @@ static void file_free(SpaceLink *sl)
}
if (sfile->params) {
- if(sfile->params->pupmenu)
- MEM_freeN(sfile->params->pupmenu);
MEM_freeN(sfile->params);
sfile->params= NULL;
}
@@ -208,6 +206,8 @@ static void file_refresh(const bContext *C, ScrArea *sa)
filelist_readdir(sfile->files);
thumbnails_start(sfile->files, C);
BLI_strncpy(params->dir, filelist_dir(sfile->files), FILE_MAX);
+ } else {
+ filelist_filter(sfile->files);
}
if(params->sort!=FILE_SORT_NONE) filelist_sort(sfile->files, params->sort);