diff options
author | Ryan Lortie <desrt@desrt.ca> | 2014-04-28 14:01:35 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-04-28 14:14:41 -0400 |
commit | f6ee00769a9190ed95857dab9fc78f935b6645db (patch) | |
tree | ceba7c549db663cee30a9910ce1304559f8f89dd /gtk/gtkmenutracker.c | |
parent | 48db84182211324cc70703da609d15e3a568f5f6 (diff) | |
download | gtk+-f6ee00769a9190ed95857dab9fc78f935b6645db.tar.gz |
GtkMenuTracker: don't specialise "submenu" link
We have some API in GtkMenuTracker and GtkMenuTrackerItem that is
specifically designed to deal with submenus.
Generalise these APIs to take a 'link_name' parameter that we always
give as G_MENU_SUBMENU for now. In the future, this will allow creating
trackers for other types of links, such as sections.
Diffstat (limited to 'gtk/gtkmenutracker.c')
-rw-r--r-- | gtk/gtkmenutracker.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gtk/gtkmenutracker.c b/gtk/gtkmenutracker.c index ee6f8b0dd7..87a6d2cb52 100644 --- a/gtk/gtkmenutracker.c +++ b/gtk/gtkmenutracker.c @@ -560,17 +560,18 @@ gtk_menu_tracker_new (GtkActionObservable *observable, } GtkMenuTracker * -gtk_menu_tracker_new_for_item_submenu (GtkMenuTrackerItem *item, - GtkMenuTrackerInsertFunc insert_func, - GtkMenuTrackerRemoveFunc remove_func, - gpointer user_data) +gtk_menu_tracker_new_for_item_link (GtkMenuTrackerItem *item, + const gchar *link_name, + GtkMenuTrackerInsertFunc insert_func, + GtkMenuTrackerRemoveFunc remove_func, + gpointer user_data) { GtkMenuTracker *tracker; GMenuModel *submenu; gchar *namespace; - submenu = _gtk_menu_tracker_item_get_submenu (item); - namespace = _gtk_menu_tracker_item_get_submenu_namespace (item); + submenu = _gtk_menu_tracker_item_get_link (item, link_name); + namespace = _gtk_menu_tracker_item_get_link_namespace (item); tracker = gtk_menu_tracker_new (_gtk_menu_tracker_item_get_observable (item), submenu, TRUE, namespace, insert_func, remove_func, user_data); |