diff options
author | Julian Eisel <julian@blender.org> | 2021-07-02 13:41:53 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-07-02 14:49:30 +0300 |
commit | 01e1944cd455448e8634ab2c44ca8a96c73af628 (patch) | |
tree | 30c29f8114c65493b3d28290098cef10e9fc0b3f /source/blender/editors/space_file/filelist.h | |
parent | 29b65f5345128ee035599aa7233315a74fe6afe6 (diff) |
File Browser: Refactor file "UUID" code (which wasn't really a "UUID")
To some degree these are changes in preparation of further Asset Browser
related changes, see D11119. But also, the current UUID design was written for
the old Asset Engine design, which isn't part of the current Asset
Browser/System design anymore.
And lastly, "UUID" are a well established standard
(https://en.wikipedia.org/wiki/Universally_unique_identifier) which this
implementation didn't follow. What we have here is more of an index, or a
unique identifier (https://en.wikipedia.org/wiki/Unique_identifier).
So this does the following changes:
* Renames "UUID" to "UID"
* Changes the type of the UID to (a typedef'ed) `uint32_t`, which is more than
enough for our current asset system design and simplifies things.
* Due to the new type, we can avoid allocations for hash-table storage.
* Add/use functions for UID handling
Note that I am working on a major rewrite of the file-list code. Meanwhile we
want to keep things sensible.
Diffstat (limited to 'source/blender/editors/space_file/filelist.h')
-rw-r--r-- | source/blender/editors/space_file/filelist.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/space_file/filelist.h b/source/blender/editors/space_file/filelist.h index 8617e0fb599..e6c4b8e1a07 100644 --- a/source/blender/editors/space_file/filelist.h +++ b/source/blender/editors/space_file/filelist.h @@ -35,6 +35,8 @@ struct wmWindowManager; struct FileDirEntry; +typedef uint32_t FileUID; + typedef enum FileSelType { FILE_SEL_REMOVE = 0, FILE_SEL_ADD = 1, @@ -97,7 +99,8 @@ FileDirEntry *filelist_file_ex(struct FileList *filelist, int index, bool use_re int filelist_file_findpath(struct FileList *filelist, const char *file); struct ID *filelist_file_get_id(const struct FileDirEntry *file); -FileDirEntry *filelist_entry_find_uuid(struct FileList *filelist, const int uuid[4]); +bool filelist_uid_is_set(const FileUID uid); +void filelist_uid_unset(FileUID *r_uid); void filelist_file_cache_slidingwindow_set(struct FileList *filelist, size_t window_size); bool filelist_file_cache_block(struct FileList *filelist, const int index); |