diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-02-07 23:07:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-02-07 23:24:05 +0400 |
commit | b3afbcab8ff2330c1473647be330a3ffe9b11885 (patch) | |
tree | e86b9c7d9676e63b8da92da79889dee13b8be186 /source/blender/editors/space_console | |
parent | 1c24d954f4ac63f22b703756b6664a4ad1b363d4 (diff) |
ListBase API: add utility api funcs for clearing and checking empty
Diffstat (limited to 'source/blender/editors/space_console')
-rw-r--r-- | source/blender/editors/space_console/space_console.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c index 5c8d1e84fd5..c4cbab4f230 100644 --- a/source/blender/editors/space_console/space_console.c +++ b/source/blender/editors/space_console/space_console.c @@ -122,8 +122,8 @@ static SpaceLink *console_duplicate(SpaceLink *sl) /* clear or remove stuff from old */ /* TODO - duplicate?, then we also need to duplicate the py namespace */ - sconsolen->scrollback.first = sconsolen->scrollback.last = NULL; - sconsolen->history.first = sconsolen->history.last = NULL; + BLI_listbase_clear(&sconsolen->scrollback); + BLI_listbase_clear(&sconsolen->history); return (SpaceLink *)sconsolen; } @@ -216,7 +216,7 @@ static void console_main_area_draw(const bContext *C, ARegion *ar) View2D *v2d = &ar->v2d; View2DScrollers *scrollers; - if (sc->scrollback.first == NULL) + if (BLI_listbase_is_empty(&sc->scrollback)) WM_operator_name_call((bContext *)C, "CONSOLE_OT_banner", WM_OP_EXEC_DEFAULT, NULL); /* clear and setup matrix */ |