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:
authorJulian Eisel <julian@blender.org>2021-07-29 18:10:11 +0300
committerJulian Eisel <julian@blender.org>2021-07-29 18:35:06 +0300
commit5be54cce3692ae590433b786d8007767e3727469 (patch)
tree9d1ea97d5c2bd931f6d0835c817b0aea2e83f6bd /source/blender/editors/asset/intern/asset_list.cc
parentb361b2f21488b99698e0964a919f20e91ad7838d (diff)
Cleanup: Pass asset handle to asset iterator, rather than wrapped file
This iterator was introduced before `AssetHandle` existed, so it was dealing with the file data directly. Now we want as little code as possible to deal with the file data, all access should happen via the `AssetHandle`.
Diffstat (limited to 'source/blender/editors/asset/intern/asset_list.cc')
-rw-r--r--source/blender/editors/asset/intern/asset_list.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/asset/intern/asset_list.cc b/source/blender/editors/asset/intern/asset_list.cc
index 445269d563e..d94a2bbf438 100644
--- a/source/blender/editors/asset/intern/asset_list.cc
+++ b/source/blender/editors/asset/intern/asset_list.cc
@@ -215,7 +215,13 @@ void AssetList::iterate(AssetListIterFn fn) const
for (int i = 0; i < numfiles; i++) {
FileDirEntry *file = filelist_file(files, i);
- if (!fn(*file)) {
+ if ((file->typeflag & FILE_TYPE_ASSET) == 0) {
+ continue;
+ }
+
+ AssetHandle asset_handle = {file};
+ if (!fn(asset_handle)) {
+ /* If the callback returns false, we stop iterating. */
break;
}
}