diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-03-24 14:28:41 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-03-24 18:10:39 +0300 |
commit | c08924bf94f2dffaae7b3ef2fad3c49cb8043c89 (patch) | |
tree | ee01dfd8f137667c39be7e3ed894236a64464751 /source/blender/windowmanager | |
parent | 60cf62ff4b08e310208dca9e35bd75131833e1aa (diff) |
Rework library_query foreach looper - add optional recursivity.
This commit:
* Fixes bad handling of 'stop iteration' (by adding a status flag, so that we can actually
stop in helper functions too, and jumping to a finalize label instead of raw return, to
allow propper clean up).
* Adds optional recursion into 'ID tree' - callback can also decide to exclude current id_pp
from recursion. Note that this implies 'readonly', modifying IDs while recursing is not
something we want to support!
* Changes callback signature/expected behavior: return behavior is now handled through flags,
and 'parent' ID of id_pp is also passed (since it may not always be root id anymore).
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1869
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 321707d1436..bbe6c76aaa2 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -4913,7 +4913,7 @@ static void previews_id_ensure(bContext *C, Scene *scene, ID *id) } } -static bool previews_id_ensure_callback(void *todo_v, ID **idptr, int UNUSED(cd_flag)) +static int previews_id_ensure_callback(void *todo_v, ID *UNUSED(idself), ID **idptr, int UNUSED(cd_flag)) { PreviewsIDEnsureStack *todo = todo_v; ID *id = *idptr; @@ -4926,7 +4926,7 @@ static bool previews_id_ensure_callback(void *todo_v, ID **idptr, int UNUSED(cd_ BLI_LINKSTACK_PUSH(todo->id_stack, id); } - return true; + return IDWALK_RET_NOP; } static int previews_ensure_exec(bContext *C, wmOperator *UNUSED(op)) |