From 5617b584202b1f967f287dfd03a4560975f1389b Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Fri, 22 Mar 2013 17:24:46 -0400 Subject: Introduce GtkMenuTracker GtkMenuTracker folds a nested structure of sections in a GMenuModel into a single linear menu, which it expresses to its user by means of 'insert item at position' and 'remove item at position' callbacks. The logic for where to insert separators and how to handle action namespaces is contained within the tracker, removing the need to have this logic duplicated in the 3 or 4 places that consume GMenuModel. In comparison with the previous code, the tracker no longer completely destroys and rebuilds menus every time a single change occurs. As a result, the new gtkmenu testcase now runs in approximately 3 seconds instead of ~60 before. https://bugzilla.gnome.org/show_bug.cgi?id=696468 --- gtk/gtkmodelmenuitem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gtk/gtkmodelmenuitem.h') diff --git a/gtk/gtkmodelmenuitem.h b/gtk/gtkmodelmenuitem.h index 655f07341b..3f24163d5b 100644 --- a/gtk/gtkmodelmenuitem.h +++ b/gtk/gtkmodelmenuitem.h @@ -34,7 +34,7 @@ G_GNUC_INTERNAL GType gtk_model_menu_item_get_type (void) G_GNUC_CONST; G_GNUC_INTERNAL -GtkMenuItem * gtk_model_menu_item_new (GMenuModel *model, +GtkWidget * gtk_model_menu_item_new (GMenuModel *model, gint item_index, const gchar *action_namespace); -- cgit v1.2.1