[Bf-blender-cvs] [e836c11] asset-experiments: Internal FileListing: generate a valid UUID, we'll need this for things like selection state...
Bastien Montagne
noreply at git.blender.org
Sat Apr 4 10:50:53 CEST 2015
Commit: e836c116aca17183df6fe447cf3cff14df774b48
Author: Bastien Montagne
Date: Thu Apr 2 20:12:18 2015 +0200
Branches: asset-experiments
https://developer.blender.org/rBe836c116aca17183df6fe447cf3cff14df774b48
Internal FileListing: generate a valid UUID, we'll need this for things like selection state...
===================================================================
M source/blender/editors/space_file/filelist.c
===================================================================
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index fce3b11..67c832e 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -48,6 +48,7 @@
#include "BLI_fileops_types.h"
#include "BLI_fnmatch.h"
#include "BLI_ghash.h"
+#include "BLI_hash_md5.h"
#include "BLI_linklist.h"
#include "BLI_math.h"
#include "BLI_stack.h"
@@ -2209,6 +2210,11 @@ static void filelist_readjob_do(
for (entry = entries.first; entry; entry = entry->next) {
BLI_join_dirfile(dir, sizeof(dir), subdir, entry->relpath);
BLI_cleanup_file(root, dir);
+
+ /* We use the mere md5sum of path as entry UUID here.
+ * entry->uuid is 16 bytes len, so we can use it directly! */
+ BLI_hash_md5_buffer(dir, strlen(dir), entry->uuid);
+
BLI_path_rel(dir, root);
/* Only thing we change in direntry here, so we need to free it first. */
MEM_freeN(entry->relpath);
More information about the Bf-blender-cvs
mailing list