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 18:32:54 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-09-28 18:32:58 +0300
commit34ba6968b2d4b4803652c3c109963a2de4b070ee (patch)
tree26cf05b9a2e829a76567f91a52428dae4870a6ca /source/blender/blenkernel/intern/asset_catalog.cc
parentf17ca53cdd2f3e3f4ccfcae404deebb02ead158d (diff)
Cleanup: asset catalog service, remove obsolete `write_to_disk` function
Remove `AssetCatalogService::write_to_disk()` function. It has been superseded by `write_to_disk_on_blendfile_save()`; the handful of test functions that called the old function have been adjusted to use the new one. No functional changes to Blender itself.
Diffstat (limited to 'source/blender/blenkernel/intern/asset_catalog.cc')
-rw-r--r--source/blender/blenkernel/intern/asset_catalog.cc23
1 files changed, 1 insertions, 22 deletions
diff --git a/source/blender/blenkernel/intern/asset_catalog.cc b/source/blender/blenkernel/intern/asset_catalog.cc
index 05e27a93621..d98d83c477f 100644
--- a/source/blender/blenkernel/intern/asset_catalog.cc
+++ b/source/blender/blenkernel/intern/asset_catalog.cc
@@ -268,31 +268,10 @@ void AssetCatalogService::merge_from_disk_before_writing()
catalog_parsed_callback);
}
-bool AssetCatalogService::write_to_disk(const CatalogFilePath &directory_for_new_files)
+bool AssetCatalogService::write_to_disk_on_blendfile_save(const CatalogFilePath &blend_file_path)
{
/* TODO(Sybren): expand to support multiple CDFs. */
- if (!catalog_definition_file_) {
- if (catalogs_.is_empty() && deleted_catalogs_.is_empty()) {
- /* Avoid saving anything, when there is nothing to save. */
- return true; /* Writing nothing when there is nothing to write is still a success. */
- }
-
- /* A CDF has to be created to contain all current in-memory catalogs. */
- const CatalogFilePath cdf_path = asset_definition_default_file_path_from_dir(
- directory_for_new_files);
- catalog_definition_file_ = construct_cdf_in_memory(cdf_path);
- }
-
- merge_from_disk_before_writing();
- return catalog_definition_file_->write_to_disk();
-}
-
-bool AssetCatalogService::write_to_disk_on_blendfile_save(const char *blend_file_path)
-{
- /* TODO(Sybren): deduplicate this and write_to_disk(...); maybe the latter function isn't even
- * necessary any more. */
-
/* - Already loaded a CDF from disk? -> Always write to that file. */
if (this->catalog_definition_file_) {
merge_from_disk_before_writing();