[Bf-blender-cvs] [8f70825923d] temp-bundled-assets: Cleanup

Jacques Lucke noreply at git.blender.org
Tue Jan 24 19:29:57 CET 2023


Commit: 8f70825923dc128039d3f64427124f2b552b3656
Author: Jacques Lucke
Date:   Tue Jan 24 19:29:42 2023 +0100
Branches: temp-bundled-assets
https://developer.blender.org/rB8f70825923dc128039d3f64427124f2b552b3656

Cleanup

===================================================================

M	source/blender/asset_system/AS_asset_bundled.h
M	source/blender/asset_system/intern/asset_bundled.cc
M	source/blender/editors/space_file/file_draw.c

===================================================================

diff --git a/source/blender/asset_system/AS_asset_bundled.h b/source/blender/asset_system/AS_asset_bundled.h
index e4b03842742..fc8a6b34ac8 100644
--- a/source/blender/asset_system/AS_asset_bundled.h
+++ b/source/blender/asset_system/AS_asset_bundled.h
@@ -10,7 +10,7 @@
 extern "C" {
 #endif
 
-bool ED_asset_bundle_contains_path(const char *path);
+bool ED_asset_bundled_contains_path(const char *path);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/asset_system/intern/asset_bundled.cc b/source/blender/asset_system/intern/asset_bundled.cc
index 85db409777b..943d8a6428a 100644
--- a/source/blender/asset_system/intern/asset_bundled.cc
+++ b/source/blender/asset_system/intern/asset_bundled.cc
@@ -4,7 +4,7 @@
  * \ingroup asset_system
  */
 
-#include "BLI_string.h"
+#include "BLI_path_util.h"
 
 #include "BKE_appdir.h"
 
@@ -23,9 +23,9 @@ StringRefNull bundled_assets_directory_path()
 
 }  // namespace blender::asset_system
 
-bool ED_asset_bundle_contains_path(const char *path)
+bool ED_asset_bundled_contains_path(const char *path)
 {
   const blender::StringRefNull bundled_path =
       blender::asset_system::bundled_assets_directory_path();
-  return BLI_str_startswith(path, bundled_path.c_str());
+  return BLI_path_contains(bundled_path.c_str(), path);
 }
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 62779692fcf..216a83b050c 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -130,7 +130,7 @@ static void draw_tile_background(const rcti *draw_rect, int colorid, int shade)
 
 static eFileAssetImportType get_asset_import_type(const SpaceFile *sfile, const char *blend_path)
 {
-  if (ED_asset_bundle_contains_path(blend_path)) {
+  if (ED_asset_bundled_contains_path(blend_path)) {
     return FILE_ASSET_IMPORT_APPEND_REUSE;
   }
   const FileAssetSelectParams *asset_params = ED_fileselect_get_asset_params(sfile);



More information about the Bf-blender-cvs mailing list