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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-04-08 15:29:33 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-04-08 15:31:49 +0300
commit3b440dbf66afd33ad8ab6f8444a425ca59c6a5c3 (patch)
tree340eb0ec795468ae57135ed33ea11c8896e53000 /source/blender/editors/space_file/filelist.c
parentc5c60099c536d2d5276c79eff9c6bda0e9d6dd60 (diff)
FileBrowser previews: Get rid of ugly, stupid and confusing 'FILE_TYPE_ICON_MOVIE' hack.
Was only handling failures in video thumbnails, was confusing (giving two different types for video files, *sigh*), and... useless, since thumbnail code already handles smartly failures in preview generation!
Diffstat (limited to 'source/blender/editors/space_file/filelist.c')
-rw-r--r--source/blender/editors/space_file/filelist.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 5214b611fb9..d5092ef46d7 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -654,7 +654,7 @@ ImBuf *filelist_geticon(struct FileList *filelist, const int index)
if (file->flags & FILE_TYPE_BLENDER) {
ibuf = gSpecialFileImages[SPECIAL_IMG_BLENDFILE];
}
- else if ((file->flags & FILE_TYPE_MOVIE) || (file->flags & FILE_TYPE_MOVIE_ICON)) {
+ else if (file->flags & FILE_TYPE_MOVIE) {
ibuf = gSpecialFileImages[SPECIAL_IMG_MOVIEFILE];
}
else if (file->flags & FILE_TYPE_SOUND) {
@@ -1334,23 +1334,23 @@ static void thumbnails_startjob(void *tjv, short *stop, short *do_update, float
tj->do_update = do_update;
while ((*stop == 0) && (limg)) {
+ ThumbSource source = 0;
+
+ BLI_assert(limg->flags & (FILE_TYPE_IMAGE | FILE_TYPE_MOVIE | FILE_TYPE_FTFONT |
+ FILE_TYPE_BLENDER | FILE_TYPE_BLENDER_BACKUP));
if (limg->flags & FILE_TYPE_IMAGE) {
- limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_IMAGE);
+ source = THB_SOURCE_IMAGE;
}
else if (limg->flags & (FILE_TYPE_BLENDER | FILE_TYPE_BLENDER_BACKUP)) {
- limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_BLEND);
+ source = THB_SOURCE_BLEND;
}
else if (limg->flags & FILE_TYPE_MOVIE) {
- limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_MOVIE);
- if (!limg->img) {
- /* remember that file can't be loaded via IMB_open_anim */
- limg->flags &= ~FILE_TYPE_MOVIE;
- limg->flags |= FILE_TYPE_MOVIE_ICON;
- }
+ source = THB_SOURCE_MOVIE;
}
else if (limg->flags & FILE_TYPE_FTFONT) {
- limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_FONT);
+ source = THB_SOURCE_FONT;
}
+ limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, source);
*do_update = true;
PIL_sleep_ms(10);
limg = limg->next;
@@ -1366,11 +1366,6 @@ static void thumbnails_update(void *tjv)
while (limg) {
if (!limg->done && limg->img) {
tj->filelist->filelist[limg->index].image = IMB_dupImBuf(limg->img);
- /* update flag for movie and font files where thumbnail can't be created */
- if (limg->flags & FILE_TYPE_MOVIE_ICON) {
- tj->filelist->filelist[limg->index].flags &= ~FILE_TYPE_MOVIE;
- tj->filelist->filelist[limg->index].flags |= FILE_TYPE_MOVIE_ICON;
- }
limg->done = true;
IMB_freeImBuf(limg->img);
limg->img = NULL;