From afaf24378ba8de2e781801b270f2d124fcd6836c Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 29 Aug 2013 18:31:58 +0100 Subject: [PATCH] Add flag to suppress redraw on node creation. --- desktop/cookie_manager.c | 6 ++++-- desktop/global_history.c | 6 ++++-- desktop/hotlist.c | 6 ++++-- desktop/treeview.h | 5 +++-- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/desktop/cookie_manager.c b/desktop/cookie_manager.c index ed39cee13..e342a2bfe 100644 --- a/desktop/cookie_manager.c +++ b/desktop/cookie_manager.c @@ -332,7 +332,8 @@ static nserror cookie_manager_create_cookie_node( parent->folder, TREE_REL_FIRST_CHILD, cookie->data, cookie, cm_ctx.built ? TREE_CREATE_NONE : - TREE_CREATE_SUPPRESS_RESIZE); + TREE_CREATE_SUPPRESS_RESIZE | + TREE_CREATE_SUPPRESS_REDRAW); if (err != NSERROR_OK) { cookie_manager_free_treeview_field_data(cookie); free(cookie); @@ -412,7 +413,8 @@ static nserror cookie_manager_create_domain_folder( err = treeview_create_node_folder(cm_ctx.tree, &(f->folder), NULL, TREE_REL_FIRST_CHILD, &f->data, f, cm_ctx.built ? TREE_CREATE_NONE : - TREE_CREATE_SUPPRESS_RESIZE); + TREE_CREATE_SUPPRESS_RESIZE | + TREE_CREATE_SUPPRESS_REDRAW); if (err != NSERROR_OK) { free((void *)f->data.value); free(f); diff --git a/desktop/global_history.c b/desktop/global_history.c index 3861ee27b..66bf37dcb 100644 --- a/desktop/global_history.c +++ b/desktop/global_history.c @@ -198,7 +198,8 @@ static nserror global_history_create_dir(enum global_history_folders f) &gh_ctx.folders[f].data, &gh_ctx.folders[f], gh_ctx.built ? TREE_CREATE_NONE : - TREE_CREATE_SUPPRESS_RESIZE); + TREE_CREATE_SUPPRESS_RESIZE | + TREE_CREATE_SUPPRESS_REDRAW); return err; } @@ -326,7 +327,8 @@ static nserror global_history_entry_insert(struct global_history_entry *e, err = treeview_create_node_entry(gh_ctx.tree, &(e->entry), parent, TREE_REL_FIRST_CHILD, e->data, e, gh_ctx.built ? TREE_CREATE_NONE : - TREE_CREATE_SUPPRESS_RESIZE); + TREE_CREATE_SUPPRESS_RESIZE | + TREE_CREATE_SUPPRESS_REDRAW); if (err != NSERROR_OK) { return err; } diff --git a/desktop/hotlist.c b/desktop/hotlist.c index 79e1061d2..6ef8385e3 100644 --- a/desktop/hotlist.c +++ b/desktop/hotlist.c @@ -141,7 +141,8 @@ static nserror hotlist_entry_insert(struct hotlist_entry *e, err = treeview_create_node_entry(hl_ctx.tree, &(e->entry), relation, rel, e->data, e, hl_ctx.built ? - TREE_CREATE_NONE : TREE_CREATE_SUPPRESS_RESIZE); + TREE_CREATE_NONE : TREE_CREATE_SUPPRESS_RESIZE | + TREE_CREATE_SUPPRESS_REDRAW); if (err != NSERROR_OK) { return err; } @@ -313,7 +314,8 @@ static nserror hotlist_add_folder_internal( err = treeview_create_node_folder(hl_ctx.tree, &n, relation, rel, &f->data, f, hl_ctx.built ? - TREE_CREATE_NONE : TREE_CREATE_SUPPRESS_RESIZE); + TREE_CREATE_NONE : TREE_CREATE_SUPPRESS_RESIZE | + TREE_CREATE_SUPPRESS_REDRAW); if (err != NSERROR_OK) { free((void *)title); /* Eww */ free(f); diff --git a/desktop/treeview.h b/desktop/treeview.h index 0ac999af1..6f443212c 100644 --- a/desktop/treeview.h +++ b/desktop/treeview.h @@ -46,8 +46,9 @@ enum treeview_relationship { typedef enum { TREE_CREATE_NONE = (0), /* No flags set */ - TREE_CREATE_SUPPRESS_RESIZE = (1 << 0) /* Suppress callback */ -} treeview_node_create_flags; /**< Relationship between nodes */ + TREE_CREATE_SUPPRESS_RESIZE = (1 << 0), /* Suppress callback */ + TREE_CREATE_SUPPRESS_REDRAW = (1 << 1) /* Suppress callback */ +} treeview_node_create_flags; /**< Node creation settings */ typedef enum { TREEVIEW_NO_FLAGS = (0), /**< No flags set */