From 34ba6968b2d4b4803652c3c109963a2de4b070ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 28 Sep 2021 17:32:54 +0200 Subject: 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. --- source/blender/blenkernel/intern/asset_catalog.cc | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source/blender/blenkernel/intern/asset_catalog.cc') 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(); -- cgit v1.2.3