diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2013-07-01 16:16:11 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2013-07-01 16:16:11 +0100 |
commit | 21cd01a9b34d2c881bde8fbe8273ce78a0b67445 (patch) | |
tree | afda162c6f0fc74e75bbc76a93c821167f89060d /desktop/global_history.c | |
parent | bc37046c6c3ef8004ccb9fb11de4bfce1e672a40 (diff) | |
download | netsurf-21cd01a9b34d2c881bde8fbe8273ce78a0b67445.tar.gz netsurf-21cd01a9b34d2c881bde8fbe8273ce78a0b67445.tar.bz2 |
Add quite param to insertion calls to suppress treeview height callback.
Diffstat (limited to 'desktop/global_history.c')
-rw-r--r-- | desktop/global_history.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/desktop/global_history.c b/desktop/global_history.c index 0a1e549d6..20bf3c9b6 100644 --- a/desktop/global_history.c +++ b/desktop/global_history.c @@ -56,6 +56,7 @@ struct global_history_ctx { struct global_history_folder folders[GH_N_FOLDERS]; time_t today; int weekday; + bool built; }; struct global_history_ctx gh_ctx; @@ -183,7 +184,8 @@ static nserror global_history_create_dir(enum global_history_folders f) &gh_ctx.folders[f].folder, relation, rel, &gh_ctx.folders[f].data, - &gh_ctx.folders[f]); + &gh_ctx.folders[f], + !gh_ctx.built); return err; } @@ -308,7 +310,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); + parent, TREE_REL_FIRST_CHILD, e->data, e, + !gh_ctx.built); if (err != NSERROR_OK) { return err; } @@ -691,6 +694,11 @@ nserror global_history_init(struct core_window_callback_table *cw_t, return err; } + /* History tree is built + * We suppress the treeview height callback on entry insertion before + * the treeview is built. */ + gh_ctx.built = true; + /* Expand the "Today" folder node */ err = treeview_node_expand(gh_ctx.tree, gh_ctx.folders[GH_TODAY].folder); |