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:
authorSybren A. Stüvel <sybren@blender.org>2021-09-28 17:07:18 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-09-28 17:09:12 +0300
commit52a702468a59f1945ecfcf6dde6bccf648a27d36 (patch)
tree4bd067c0c0435a0f6d155f671119eea1acc142a3 /source/blender/blenkernel/BKE_asset_catalog.hh
parentd2004326a1f96f85cb1b6f7c57712de8998ecca0 (diff)
Asset Catalog Service: add function to change catalog path
Add `AssetCatalogService::update_catalog_path()` to change the catalog path of the given catalog, and also change the path of all the catalogs contained within the given catalog. Rebuilds the tree structure for the UI, but does not save the new catalog definitions to disk. No user-facing changes, just backend preparation for UI work.
Diffstat (limited to 'source/blender/blenkernel/BKE_asset_catalog.hh')
-rw-r--r--source/blender/blenkernel/BKE_asset_catalog.hh14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_asset_catalog.hh b/source/blender/blenkernel/BKE_asset_catalog.hh
index 7b54d7cf572..9b8b99f8f6d 100644
--- a/source/blender/blenkernel/BKE_asset_catalog.hh
+++ b/source/blender/blenkernel/BKE_asset_catalog.hh
@@ -118,6 +118,11 @@ class AssetCatalogService {
* written. */
void delete_catalog(CatalogID catalog_id);
+ /**
+ * Update the catalog path, also updating the catalog path of all sub-catalogs.
+ */
+ void update_catalog_path(CatalogID catalog_id, const CatalogPath &new_catalog_path);
+
AssetCatalogTree *get_catalog_tree();
/** Return true only if there are no catalogs known. */
@@ -301,6 +306,15 @@ class AssetCatalog {
} flags;
/**
+ * \return true only if this catalog's path is contained within the given path.
+ * When this catalog's path is equal to the given path, return true as well.
+ *
+ * Note that non-normalized paths (so for example starting or ending with a slash) are not
+ * supported, and result in undefined behaviour.
+ */
+ bool is_contained_in(const CatalogPath &other_path) const;
+
+ /**
* Create a new Catalog with the given path, auto-generating a sensible catalog simple-name.
*
* NOTE: the given path will be cleaned up (trailing spaces removed, etc.), so the returned