Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_file/filelist.c
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static void filelist_cache_previews_push(FileList *filelist, FileDirEntry *entry, const int index) | static void filelist_cache_previews_push(FileList *filelist, FileDirEntry *entry, const int index) | ||||
| { | { | ||||
| FileListEntryCache *cache = &filelist->filelist_cache; | FileListEntryCache *cache = &filelist->filelist_cache; | ||||
| BLI_assert(cache->flags & FLC_PREVIEWS_ACTIVE); | BLI_assert(cache->flags & FLC_PREVIEWS_ACTIVE); | ||||
| if (!entry->preview_icon_id && (entry->attributes & FILE_ATTR_OFFLINE)) { | if (entry->preview_icon_id) { | ||||
| entry->flags |= FILE_ENTRY_INVALID_PREVIEW; | |||||
| return; | return; | ||||
| } | } | ||||
| if (entry->preview_icon_id) { | if (entry->attributes & FILE_ATTR_OFFLINE) { | ||||
| char path[MAX_PATH]; | |||||
| BLI_join_dirfile(path, sizeof(path), filelist->filelist.root, entry->relpath); | |||||
| ImBuf *ibuf = IMB_thumb_read(path, THB_LARGE); | |||||
| if (ibuf) { | |||||
| entry->preview_icon_id = BKE_icon_imbuf_create(ibuf); | |||||
| } | |||||
| return; | return; | ||||
| } | } | ||||
| if (entry->flags & (FILE_ENTRY_INVALID_PREVIEW | FILE_ENTRY_PREVIEW_LOADING)) { | if (entry->flags & (FILE_ENTRY_INVALID_PREVIEW | FILE_ENTRY_PREVIEW_LOADING)) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (!(entry->typeflag & (FILE_TYPE_IMAGE | FILE_TYPE_MOVIE | FILE_TYPE_FTFONT | | if (!(entry->typeflag & (FILE_TYPE_IMAGE | FILE_TYPE_MOVIE | FILE_TYPE_FTFONT | | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||