[Bf-blender-cvs] [a267710] master: FileBrowser: Always do full cache refresh while we are still listing...
Bastien Montagne
noreply at git.blender.org
Tue Sep 13 19:03:58 CEST 2016
Commit: a2677100fef06afdbede1985028520be6646efc2
Author: Bastien Montagne
Date: Tue Sep 13 19:02:27 2016 +0200
Branches: master
https://developer.blender.org/rBa2677100fef06afdbede1985028520be6646efc2
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.
===================================================================
M source/blender/editors/space_file/filelist.c
===================================================================
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 1471932..b60487a 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;
More information about the Bf-blender-cvs
mailing list