From: Darren S. <li...@yo...> - 2007-02-02 21:29:28
|
# HG changeset patch # User Darren Salt <li...@yo...> # Date 1170423215 0 # Node ID 4785c4a5145f4ecbb831fdbe3ea72fb8a51807a8 # Parent 129d837e5c0ee47725c4a0d32b1099ae25de279b Minor optimisations. diff -r 4785c4a5145f4ecbb831fdbe3ea72fb8a51807a8 -r 129d837e5c0ee47725c4a0d32b1099ae25de279b src/key_events.c --- a/src/key_events.c Fri Feb 02 13:33:35 2007 +0000 +++ b/src/key_events.c Thu Feb 01 23:10:14 2007 +0000 @@ -1433,8 +1433,8 @@ void key_events_init (void) GError *error; GtkUIManager *ui = ui_create_manager ("bindings", kb_bindings_list_dlg); - - gtk_action_group_add_actions (ui_get_action_group (ui), + GtkActionGroup *actions = ui_get_action_group (ui); + gtk_action_group_add_actions (actions, kb_menu_data, G_N_ELEMENTS(kb_menu_data), kb_bindings_list_dlg); gtk_ui_manager_add_ui_from_string (ui, kb_menu_structure, -1, &error); @@ -1442,7 +1442,7 @@ void key_events_init (void) (GTK_BOX(hbox), gtk_ui_manager_get_widget (ui, "/toolbar"), TRUE, TRUE, 0); gtk_box_pack_end (GTK_BOX(hbox), gtk_ui_manager_get_widget (ui, "/menubar"), FALSE, FALSE, 0); - gtk_action_group_connect_accelerators (ui_get_action_group (ui)); + gtk_action_group_connect_accelerators (actions); } gtk_box_pack_start (GTK_BOX(GTK_DIALOG(kb_bindings_list_dlg)->vbox), hbox, diff -r 4785c4a5145f4ecbb831fdbe3ea72fb8a51807a8 -r 129d837e5c0ee47725c4a0d32b1099ae25de279b src/mediamarks.c --- a/src/mediamarks.c Fri Feb 02 13:33:35 2007 +0000 +++ b/src/mediamarks.c Thu Feb 01 23:10:14 2007 +0000 @@ -810,7 +810,8 @@ void mediamarks_init (void) /* buttons & menus */ mm_ui = ui_create_manager ("mm", manage_dlg); - gtk_action_group_add_actions (ui_get_action_group (mm_ui), buttons_data, + GtkActionGroup *group = ui_get_action_group (mm_ui); + gtk_action_group_add_actions (group, buttons_data, G_N_ELEMENTS (buttons_data), tree); gtk_ui_manager_add_ui_from_string (mm_ui, buttons_structure, -1, &error); if (error) @@ -820,8 +821,8 @@ void mediamarks_init (void) } menu[0] = GTK_MENU (gtk_ui_manager_get_widget (mm_ui, "/ui/list_menu")); menu[1] = GTK_MENU (gtk_ui_manager_get_widget (mm_ui, "/ui/item_menu")); - play_item = gtk_action_group_get_action (ui_get_action_group (mm_ui), "play"); - gtk_action_group_connect_accelerators (ui_get_action_group (mm_ui)); + play_item = gtk_action_group_get_action (group, "play"); + gtk_action_group_connect_accelerators (group); /* * init tree store diff -r 4785c4a5145f4ecbb831fdbe3ea72fb8a51807a8 -r 129d837e5c0ee47725c4a0d32b1099ae25de279b src/playlist.c --- a/src/playlist.c Fri Feb 02 13:33:35 2007 +0000 +++ b/src/playlist.c Thu Feb 01 23:10:14 2007 +0000 @@ -2298,7 +2298,8 @@ void playlist_init (void) */ pl_ui = ui_create_manager ("file", dlg); - gtk_action_group_add_actions (ui_get_action_group (pl_ui), buttons_data, + GtkActionGroup *actions = ui_get_action_group (pl_ui); + gtk_action_group_add_actions (actions, buttons_data, G_N_ELEMENTS (buttons_data), (GtkWidget *)tree_view); gtk_ui_manager_add_ui_from_string (pl_ui, buttons_structure, -1, &error); if (error) @@ -2308,7 +2309,7 @@ void playlist_init (void) } menu[0] = gtk_ui_manager_get_widget (pl_ui, "/ui/list_menu"); menu[1] = gtk_ui_manager_get_widget (pl_ui, "/ui/item_menu"); - gtk_action_group_connect_accelerators (ui_get_action_group (pl_ui)); + gtk_action_group_connect_accelerators (actions); /* * window |