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>2022-11-08 18:26:49 +0300
committerJulian Eisel <julian@blender.org>2022-11-08 18:26:49 +0300
commitffafde7bd672b582fe392119fe91627a7c904b3e (patch)
tree64023e8f28414f9fc503190364b560681e061c64 /source/blender
parent84cc68b68f5d11ddc7b132e7d76b99715d590eb5 (diff)
Cleanup: Remove unncessary stoarage wrapper class
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_asset_library.hh9
-rw-r--r--source/blender/blenkernel/BKE_asset_representation.hh2
-rw-r--r--source/blender/blenkernel/intern/asset_library.cc12
3 files changed, 6 insertions, 17 deletions
diff --git a/source/blender/blenkernel/BKE_asset_library.hh b/source/blender/blenkernel/BKE_asset_library.hh
index 091df6d8edd..d0140b2b3f7 100644
--- a/source/blender/blenkernel/BKE_asset_library.hh
+++ b/source/blender/blenkernel/BKE_asset_library.hh
@@ -29,13 +29,6 @@ namespace blender::bke {
struct AssetRepresentation;
-class AssetStorage {
- Vector<std::unique_ptr<AssetRepresentation>> assets_;
-
- public:
- AssetRepresentation &append(std::unique_ptr<AssetRepresentation> asset);
-};
-
/**
* AssetLibrary provides access to an asset library's data.
*
@@ -85,7 +78,7 @@ struct AssetLibrary {
* So this really is arbitrary storage as far as #AssetLibrary is concerned (allowing the API
* user to manage partial library storage and partial loading, so only relevant parts of a
* library are kept in memory). */
- AssetStorage asset_storage_;
+ Vector<std::unique_ptr<AssetRepresentation>> asset_storage_;
};
Vector<AssetLibraryReference> all_valid_asset_library_refs();
diff --git a/source/blender/blenkernel/BKE_asset_representation.hh b/source/blender/blenkernel/BKE_asset_representation.hh
index 2acf30fbc88..35aecba51e5 100644
--- a/source/blender/blenkernel/BKE_asset_representation.hh
+++ b/source/blender/blenkernel/BKE_asset_representation.hh
@@ -16,7 +16,7 @@ namespace blender::bke {
/**
* \brief Abstraction to reference an asset, with necessary data for display & interaction.
*
- * #AssetRepresentation is the core data-structure to store information about an asset. It doesn't
+ * #AssetRepresentation is the data-structure to store information about a single asset. It doesn't
* contain the asset itself, but information like the metadata and preview, as well as methods to
* interact with them. Think of it like a view on an asset.
*/
diff --git a/source/blender/blenkernel/intern/asset_library.cc b/source/blender/blenkernel/intern/asset_library.cc
index a6243876d34..4efa2c33891 100644
--- a/source/blender/blenkernel/intern/asset_library.cc
+++ b/source/blender/blenkernel/intern/asset_library.cc
@@ -126,12 +126,14 @@ void AssetLibrary::refresh()
AssetRepresentation &AssetLibrary::add_external_asset(std::unique_ptr<AssetMetaData> metadata)
{
- return asset_storage_.append(std::make_unique<AssetRepresentation>(std::move(metadata)));
+ asset_storage_.append(std::make_unique<AssetRepresentation>(std::move(metadata)));
+ return *asset_storage_.last();
}
AssetRepresentation &AssetLibrary::add_local_id_asset(const ID &id)
{
- return asset_storage_.append(std::make_unique<AssetRepresentation>(id));
+ asset_storage_.append(std::make_unique<AssetRepresentation>(id));
+ return *asset_storage_.last();
}
namespace {
@@ -213,10 +215,4 @@ Vector<AssetLibraryReference> all_valid_asset_library_refs()
return result;
}
-AssetRepresentation &AssetStorage::append(std::unique_ptr<AssetRepresentation> asset)
-{
- assets_.append(std::move(asset));
- return *assets_.last();
-}
-
} // namespace blender::bke