diff options
author | António Fernandes <antoniof@gnome.org> | 2019-06-23 15:24:33 +0100 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2020-03-10 14:02:26 +0000 |
commit | 002403b00f058bcf5d985197f92182bf25212f9c (patch) | |
tree | 700956063bb9ff3a176aa1c589af228f83a6f488 /src/nautilus-pathbar.c | |
parent | 3ea5529e5a50f07938d29328d35238d11ae3c324 (diff) | |
download | nautilus-002403b00f058bcf5d985197f92182bf25212f9c.tar.gz |
view: Cast exported menus as models
The view exports the background extensions and templates menu models for
consumption by the pathbar. They are exported as GMenu.
However, the consumer is not supposed to modify the menu, which is what
the GMenu API is for. Also, it needs to cast to GMenuModel everytime.
To make this clearer and cleaner, cast to GMenuModel at the point when
the GMenu API is not going to be used anymore.
Diffstat (limited to 'src/nautilus-pathbar.c')
-rw-r--r-- | src/nautilus-pathbar.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c index 820a562b9..5e1fa3021 100644 --- a/src/nautilus-pathbar.c +++ b/src/nautilus-pathbar.c @@ -918,22 +918,20 @@ nautilus_path_bar_class_init (NautilusPathBarClass *path_bar_class) void nautilus_path_bar_set_extensions_background_menu (NautilusPathBar *self, - GMenu *menu) + GMenuModel *menu) { g_return_if_fail (NAUTILUS_IS_PATH_BAR (self)); - nautilus_gmenu_set_from_model (self->extensions_section, - G_MENU_MODEL (menu)); + nautilus_gmenu_set_from_model (self->extensions_section, menu); } void nautilus_path_bar_set_templates_menu (NautilusPathBar *self, - GMenu *menu) + GMenuModel *menu) { g_return_if_fail (NAUTILUS_IS_PATH_BAR (self)); - nautilus_gmenu_set_from_model (self->templates_submenu, - G_MENU_MODEL (menu)); + nautilus_gmenu_set_from_model (self->templates_submenu, menu); } /* Changes the icons wherever it is needed */ |