From fef9c29ed78b87193ad951bf64e962bfa7cff0cd Mon Sep 17 00:00:00 2001 From: Rob Date: Fri, 20 Nov 2009 14:50:49 +0100 Subject: generate BUITLINS event only once on startup --- uzbl-core.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'uzbl-core.c') diff --git a/uzbl-core.c b/uzbl-core.c index e25385c..e2f550b 100644 --- a/uzbl-core.c +++ b/uzbl-core.c @@ -652,8 +652,7 @@ struct {const char *key; CommandInfo value;} cmdlist[] = { "menu_image_remove", {menu_remove_image, TRUE} }, { "menu_editable_remove", {menu_remove_edit, TRUE} }, { "hardcopy", {hardcopy, TRUE} }, - { "include", {include, TRUE} }, - { "builtins", {builtins, TRUE} } + { "include", {include, TRUE} } }; void @@ -666,14 +665,8 @@ commands_hash(void) g_hash_table_insert(uzbl.behave.commands, (gpointer) cmdlist[i].key, &cmdlist[i].value); } -// TODO: we should probably build the command list once and just re-use that on every -// invocation of "builtins" void -builtins(WebKitWebView *page, GArray *argv, GString *result) { - (void) page; - (void) argv; - // see TODO below - (void) result; +builtins() { unsigned int i, len = LENGTH(cmdlist); GString *command_list = g_string_new(""); @@ -683,9 +676,6 @@ builtins(WebKitWebView *page, GArray *argv, GString *result) { g_string_append_c(command_list, ' '); } - // TODO: Do we also want to query for the builtins without generating an event? - //result = command_list; - send_event(BUILTINS, command_list->str, NULL); g_string_free(command_list, TRUE); } @@ -2521,6 +2511,9 @@ main (int argc, char* argv[]) { g_free(t); } + /* generate an event with a list of built in commands */ + builtins(); + gtk_widget_grab_focus (GTK_WIDGET (uzbl.gui.web_view)); if (uzbl.state.verbose) { -- cgit v1.2.3