diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-09-13 20:02:27 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-09-13 20:02:27 +0300 |
commit | a2677100fef06afdbede1985028520be6646efc2 (patch) | |
tree | 00700d15cc9909ea043f54168d0c328176e27ce2 /source/blender/editors/space_file/filelist.c | |
parent | 0de69e56b43f194d3d79ad28c3cd6e49e88aa8d2 (diff) |
FileBrowser: Always do full cache refresh while we are still listing...
Does not seem to be a problem with embeded filelisting code, but was breaking with some experimental asset engines.
Diffstat (limited to 'source/blender/editors/space_file/filelist.c')
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 14719322bf7..b60487a4855 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1651,6 +1651,7 @@ bool filelist_file_cache_block(struct FileList *filelist, const int index) int start_index = max_ii(0, index - (cache_size / 2)); int end_index = min_ii(nbr_entries, index + (cache_size / 2)); int i; + const bool full_refresh = (filelist->flags & FL_IS_READY) != 0; if ((index < 0) || (index >= nbr_entries)) { // printf("Wrong index %d ([%d:%d])", index, 0, nbr_entries); @@ -1673,8 +1674,8 @@ bool filelist_file_cache_block(struct FileList *filelist, const int index) // start_index, end_index, index, cache->block_start_index, cache->block_end_index); /* If we have something to (re)cache... */ - if ((start_index != cache->block_start_index) || (end_index != cache->block_end_index)) { - if ((start_index >= cache->block_end_index) || (end_index <= cache->block_start_index)) { + if (full_refresh || (start_index != cache->block_start_index) || (end_index != cache->block_end_index)) { + if (full_refresh || (start_index >= cache->block_end_index) || (end_index <= cache->block_start_index)) { int size1 = cache->block_end_index - cache->block_start_index; int size2 = 0; int idx1 = cache->block_cursor, idx2 = 0; |