[Bf-blender-cvs] [99373c9] asset-experiments: Add a 'comment' field to listdir revisions.

Bastien Montagne noreply at git.blender.org
Tue Mar 17 16:03:25 CET 2015


Commit: 99373c918f158af7c6b25f58d2091717797fd359
Author: Bastien Montagne
Date:   Tue Mar 17 15:39:20 2015 +0100
Branches: asset-experiments
https://developer.blender.org/rB99373c918f158af7c6b25f58d2091717797fd359

Add a 'comment' field to listdir revisions.

Also, make clear tags are only informative here.

Reason is, if the project is a success, we have to think big and
imagine asset engines managing catalogs of tens or hundreds of thousands
of entries (web ones e.g.), we cannot hold list of those in filebrowser!
So most of filetring will be 'deffered' to asset-engine.

We'll also probably have to implement a 'chunck listing' behavior
(to only list at most n entries in a row), for same reasons.

This will make things slightly more complicated :|

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

M	source/blender/editors/space_file/filelist.c
M	source/blender/makesdna/DNA_space_types.h

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

diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 3eaf712..9e442dd 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -965,7 +965,18 @@ static void filelist_entry_free(FileDirEntry *entry, const bool clear)
 			if (var->description) {
 				MEM_freeN(var->description);
 			}
-			BLI_freelistN(&var->revisions);
+
+			if (!BLI_listbase_is_empty(&var->revisions)) {
+				FileDirEntryRevision *rev;
+
+				for (rev = var->revisions.first; rev; rev = rev->next) {
+					if (rev->comment) {
+						MEM_freeN(rev->comment);
+					}
+				}
+
+				BLI_freelistN(&var->revisions);
+			}
 		}
 
 		/* TODO: tags! */
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 399ea68..df6be88 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -769,8 +769,7 @@ typedef struct FileDirEntryRevision {
 	 */
 	char uuid[24];  /* ASSET_UUID_LENGTH */
 
-	/* Shall we also add a description to revisions? Could contain commit messages e.g.
-	 * But would also likely make explode memory usage? */
+	char *comment;
 
 	uint64_t size;
 	int64_t time;
@@ -829,6 +828,7 @@ typedef struct FileDirEntry {
 	void *poin;  /* TODO: make this a real ID pointer? */
 	struct ImBuf *image;
 
+	/* Tags are for info only, most of filtering is done in asset engine. */
 	char **tags;
 	int nbr_tags;




More information about the Bf-blender-cvs mailing list