Commit 544c1cca authored by Carlos Soriano's avatar Carlos Soriano

pathbar: Extend button menu with extensions and templates

One of the benefits of the new menu on the path bar buttons is that we
show the background menu.

This was the intended design since the start, but we didn't come to
finalize it earlier on.

Now with the 3.30 approaching, this work implements that.

Closes #405
parent 28f2922a
Pipeline #20358 passed with stage
in 1 minute and 37 seconds
......@@ -144,6 +144,8 @@ enum
PROP_SELECTION,
PROP_LOCATION,
PROP_SEARCH_QUERY,
PROP_EXTENSIONS_BACKGROUND_MENU,
PROP_TEMPLATES_MENU,
NUM_PROPERTIES
};
......@@ -262,6 +264,10 @@ typedef struct
GtkWidget *zoom_controls_box;
GtkWidget *zoom_level_label;
/* Exposed menus, for the path bar etc. */
GMenu *extensions_background_menu;
GMenu *templates_menu;
gulong stop_signal_handler;
gulong reload_signal_handler;
......@@ -689,6 +695,98 @@ nautilus_files_view_get_toolbar_menu_sections (NautilusView *view)
return priv->toolbar_menu_sections;
}
static GMenu*
nautilus_files_view_get_templates_menu (NautilusView *self)
{
GMenu *menu;
g_object_get (self, "templates-menu", &menu, NULL);
return menu;
}
static GMenu*
nautilus_files_view_get_extensions_background_menu (NautilusView *self)
{
GMenu *menu;
g_object_get (self, "extensions-background-menu", &menu, NULL);
return menu;
}
static GMenu*
real_get_extensions_background_menu (NautilusView *view)
{
NautilusFilesViewPrivate *priv;
g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), NULL);
priv = nautilus_files_view_get_instance_private (NAUTILUS_FILES_VIEW (view));
return priv->extensions_background_menu;
}
static GMenu*
real_get_templates_menu (NautilusView *view)
{
NautilusFilesViewPrivate *priv;
g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), NULL);
priv = nautilus_files_view_get_instance_private (NAUTILUS_FILES_VIEW (view));
return priv->templates_menu;
}
static void
nautilus_files_view_set_templates_menu (NautilusView *self,
GMenu *menu)
{
g_object_set (self, "templates-menu", menu, NULL);
}
static void
nautilus_files_view_set_extensions_background_menu (NautilusView *self,
GMenu *menu)
{
g_object_set (self, "extensions-background-menu", menu, NULL);
}
static void
real_set_extensions_background_menu (NautilusView *view,
GMenu *menu)
{
NautilusFilesViewPrivate *priv;
g_return_if_fail (NAUTILUS_IS_FILES_VIEW (view));
priv = nautilus_files_view_get_instance_private (NAUTILUS_FILES_VIEW (view));
if (priv->extensions_background_menu != NULL)
{
g_clear_object (&priv->extensions_background_menu);
}
priv->extensions_background_menu = menu;
}
static void
real_set_templates_menu (NautilusView *view,
GMenu *menu)
{
NautilusFilesViewPrivate *priv;
g_return_if_fail (NAUTILUS_IS_FILES_VIEW (view));
priv = nautilus_files_view_get_instance_private (NAUTILUS_FILES_VIEW (view));
if (priv->templates_menu != NULL)
{
g_clear_object (&priv->extensions_background_menu);
}
priv->templates_menu = menu;
}
static gboolean
showing_trash_directory (NautilusFilesView *view)
{
......@@ -3204,6 +3302,8 @@ nautilus_files_view_finalize (GObject *object)
g_clear_object (&priv->selection_menu);
g_clear_object (&priv->toolbar_menu_sections->zoom_section);
g_clear_object (&priv->toolbar_menu_sections->extended_section);
g_clear_object (&priv->extensions_background_menu);
g_clear_object (&priv->templates_menu);
g_clear_object (&priv->rename_file_controller);
g_clear_object (&priv->new_folder_controller);
g_clear_object (&priv->compress_controller);
......@@ -4960,49 +5060,42 @@ build_menu_for_extension_menu_items (NautilusFilesView *view,
return gmenu;
}
static void
add_extension_menu_items (NautilusFilesView *view,
const gchar *extension_prefix,
GList *menu_items,
GMenu *insertion_menu)
{
GMenu *menu;
menu = build_menu_for_extension_menu_items (view, extension_prefix, menu_items);
nautilus_gmenu_merge (insertion_menu,
menu,
"extensions",
FALSE);
g_object_unref (menu);
}
static void
update_extensions_menus (NautilusFilesView *view)
{
NautilusFilesViewPrivate *priv;
GList *selection_items, *background_items;
g_autoptr (GMenu) background_menu = NULL;
g_autoptr (GMenu) selection_menu = NULL;
priv = nautilus_files_view_get_instance_private (view);
selection_items = get_extension_selection_menu_items (view);
if (selection_items != NULL)
{
add_extension_menu_items (view,
"selection",
selection_items,
priv->selection_menu);
selection_menu = build_menu_for_extension_menu_items (view, "extensions",
selection_items);
nautilus_gmenu_merge (priv->selection_menu,
selection_menu,
"extensions",
FALSE);
nautilus_menu_item_list_free (selection_items);
}
background_items = get_extension_background_menu_items (view);
if (background_items != NULL)
{
add_extension_menu_items (view,
"background",
background_items,
priv->background_menu);
background_menu = build_menu_for_extension_menu_items (view, "extensions",
background_items);
nautilus_gmenu_merge (priv->background_menu,
background_menu,
"extensions",
FALSE);
nautilus_menu_item_list_free (background_items);
}
nautilus_view_set_extensions_background_menu (NAUTILUS_VIEW (view), background_menu);
}
static char *
......@@ -5707,7 +5800,7 @@ update_templates_menu (NautilusFilesView *view)
NautilusFilesViewPrivate *priv;
GList *sorted_copy, *node;
NautilusDirectory *directory;
GMenu *submenu;
g_autoptr (GMenu) submenu = NULL;
char *uri;
char *templates_directory_uri;
......@@ -5748,9 +5841,10 @@ update_templates_menu (NautilusFilesView *view)
submenu,
"templates-submenu",
FALSE);
g_object_unref (submenu);
}
nautilus_view_set_templates_menu (NAUTILUS_VIEW (view), submenu);
nautilus_directory_unref (directory);
priv->templates_present = submenu != NULL;
......@@ -8937,8 +9031,25 @@ nautilus_files_view_get_property (GObject *object,
}
break;
case PROP_EXTENSIONS_BACKGROUND_MENU:
{
g_value_set_object (value,
real_get_extensions_background_menu (NAUTILUS_VIEW (view)));
}
break;
case PROP_TEMPLATES_MENU:
{
g_value_set_object (value,
real_get_templates_menu (NAUTILUS_VIEW (view)));
}
break;
default:
{
g_assert_not_reached ();
}
break;
}
}
......@@ -8994,6 +9105,20 @@ nautilus_files_view_set_property (GObject *object,
}
break;
case PROP_EXTENSIONS_BACKGROUND_MENU:
{
real_set_extensions_background_menu (NAUTILUS_VIEW (directory_view),
g_value_get_object (value));
}
break;
case PROP_TEMPLATES_MENU:
{
real_set_templates_menu (NAUTILUS_VIEW (directory_view),
g_value_get_object (value));
}
break;
default:
{
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......@@ -9353,6 +9478,10 @@ nautilus_files_view_iface_init (NautilusViewInterface *iface)
iface->is_searching = nautilus_files_view_is_searching;
iface->is_loading = nautilus_files_view_is_loading;
iface->get_view_id = nautilus_files_view_get_view_id;
iface->get_templates_menu = nautilus_files_view_get_templates_menu;
iface->set_templates_menu = nautilus_files_view_set_templates_menu;
iface->get_extensions_background_menu = nautilus_files_view_get_extensions_background_menu;
iface->set_extensions_background_menu = nautilus_files_view_set_extensions_background_menu;
}
static void
......@@ -9477,6 +9606,8 @@ nautilus_files_view_class_init (NautilusFilesViewClass *klass)
g_object_class_override_property (oclass, PROP_LOCATION, "location");
g_object_class_override_property (oclass, PROP_SELECTION, "selection");
g_object_class_override_property (oclass, PROP_SEARCH_QUERY, "search-query");
g_object_class_override_property (oclass, PROP_EXTENSIONS_BACKGROUND_MENU, "extensions-background-menu");
g_object_class_override_property (oclass, PROP_TEMPLATES_MENU, "templates-menu");
}
static void
......
......@@ -106,7 +106,10 @@ typedef struct
unsigned int drag_slider_timeout;
gboolean drag_slider_timeout_for_up_button;
GtkPopover *current_view_menu;
GtkPopover *current_view_menu_popover;
GMenu *current_view_menu;
GMenu *extensions_background_menu;
GMenu *templates_menu;
GtkGesture *up_slider_button_long_press_gesture;
GtkGesture *down_slider_button_long_press_gesture;
......@@ -235,7 +238,9 @@ nautilus_path_bar_init (NautilusPathBar *self)
/* Context menu */
builder = gtk_builder_new_from_resource ("/org/gnome/nautilus/ui/nautilus-pathbar-context-menu.ui");
priv->current_view_menu = g_object_ref (GTK_POPOVER (gtk_builder_get_object (builder, "menu_popover"))),
priv->current_view_menu = g_object_ref_sink (G_MENU (gtk_builder_get_object (builder, "current-view-menu")));
priv->current_view_menu_popover = GTK_POPOVER (gtk_popover_new_from_model (NULL,
G_MENU_MODEL (priv->current_view_menu)));
g_object_unref (builder);
gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
......@@ -313,6 +318,7 @@ nautilus_path_bar_finalize (GObject *object)
}
g_list_free (priv->button_list);
g_clear_object (&priv->current_view_menu);
G_OBJECT_CLASS (nautilus_path_bar_parent_class)->finalize (object);
}
......@@ -1220,6 +1226,81 @@ nautilus_path_bar_class_init (NautilusPathBarClass *path_bar_class)
gtk_container_class_handle_border_width (container_class);
}
static void
update_current_view_menu (NautilusPathBar *self)
{
NautilusPathBarPrivate *priv;
priv = nautilus_path_bar_get_instance_private (self);
if (priv->extensions_background_menu != NULL)
{
nautilus_gmenu_merge (priv->current_view_menu,
priv->extensions_background_menu,
"extensions",
TRUE);
}
if (priv->templates_menu != NULL)
{
nautilus_gmenu_merge (priv->current_view_menu, priv->templates_menu,
"templates-submenu", TRUE);
}
}
static void
reset_current_view_menu (NautilusPathBar *self)
{
NautilusPathBarPrivate *priv;
g_autoptr (GtkBuilder) builder = NULL;
priv = nautilus_path_bar_get_instance_private (self);
g_clear_object (&priv->current_view_menu);
builder = gtk_builder_new_from_resource ("/org/gnome/nautilus/ui/nautilus-pathbar-context-menu.ui");
priv->current_view_menu = g_object_ref_sink (G_MENU (gtk_builder_get_object (builder,
"current-view-menu")));
gtk_popover_bind_model (priv->current_view_menu_popover,
G_MENU_MODEL (priv->current_view_menu), NULL);
}
void
nautilus_path_bar_set_extensions_background_menu (NautilusPathBar *self,
GMenu *menu)
{
NautilusPathBarPrivate *priv;
g_return_if_fail (NAUTILUS_IS_PATH_BAR (self));
priv = nautilus_path_bar_get_instance_private (self);
reset_current_view_menu (self);
g_clear_object (&priv->extensions_background_menu);
if (menu != NULL)
{
priv->extensions_background_menu = g_object_ref (menu);
}
update_current_view_menu (self);
}
void
nautilus_path_bar_set_templates_menu (NautilusPathBar *self,
GMenu *menu)
{
NautilusPathBarPrivate *priv;
g_return_if_fail (NAUTILUS_IS_PATH_BAR (self));
priv = nautilus_path_bar_get_instance_private (self);
reset_current_view_menu (self);
g_clear_object (&priv->templates_menu);
if (menu != NULL)
{
priv->templates_menu = g_object_ref (menu);
}
update_current_view_menu (self);
}
static void
nautilus_path_bar_scroll_down (NautilusPathBar *self)
{
......@@ -1567,7 +1648,7 @@ button_clicked_cb (GtkWidget *button,
{
if (g_file_equal (button_data->path, priv->current_path))
{
gtk_popover_popup (priv->current_view_menu);
gtk_popover_popup (priv->current_view_menu_popover);
}
else
{
......@@ -2005,7 +2086,7 @@ make_button_data (NautilusPathBar *self,
if (current_dir)
{
gtk_widget_show (button_data->disclosure_arrow);
gtk_popover_set_relative_to (priv->current_view_menu, button_data->button);
gtk_popover_set_relative_to (priv->current_view_menu_popover, button_data->button);
}
if (button_data->label != NULL)
......
......@@ -34,4 +34,8 @@ struct _NautilusPathBarClass
GFile *location,
GtkPlacesOpenFlags flags);
};
void nautilus_path_bar_set_path (NautilusPathBar *self, GFile *file);
\ No newline at end of file
void nautilus_path_bar_set_path (NautilusPathBar *self, GFile *file);
void nautilus_path_bar_set_extensions_background_menu (NautilusPathBar *self,
GMenu *menu);
void nautilus_path_bar_set_templates_menu (NautilusPathBar *self,
GMenu *menu);
......@@ -1233,6 +1233,24 @@ container_remove_all_children (GtkContainer *container)
g_list_free (children);
}
static void
slot_on_extensions_background_menu_changed (NautilusToolbar *self,
GParamSpec *param,
NautilusWindowSlot *slot)
{
nautilus_path_bar_set_extensions_background_menu (NAUTILUS_PATH_BAR (self->path_bar),
nautilus_window_slot_get_extensions_background_menu (slot));
}
static void
slot_on_templates_menu_changed (NautilusToolbar *self,
GParamSpec *param,
NautilusWindowSlot *slot)
{
nautilus_path_bar_set_templates_menu (NAUTILUS_PATH_BAR (self->path_bar),
nautilus_window_slot_get_templates_menu (slot));
}
static void
on_slot_toolbar_menu_sections_changed (NautilusToolbar *self,
GParamSpec *param,
......@@ -1344,7 +1362,10 @@ nautilus_toolbar_set_window_slot (NautilusToolbar *self,
on_slot_toolbar_menu_sections_changed (self, NULL, self->window_slot);
g_signal_connect_swapped (self->window_slot, "notify::toolbar-menu-sections",
G_CALLBACK (on_slot_toolbar_menu_sections_changed), self);
g_signal_connect_swapped (self->window_slot, "notify::extensions-background-menu",
G_CALLBACK (slot_on_extensions_background_menu_changed), self);
g_signal_connect_swapped (self->window_slot, "notify::templates-menu",
G_CALLBACK (slot_on_templates_menu_changed), self);
g_signal_connect_swapped (window_slot, "notify::searching",
G_CALLBACK (toolbar_update_appearance), self);
......
......@@ -83,6 +83,29 @@ nautilus_view_default_init (NautilusViewInterface *iface)
"The search query being performed on the view",
NAUTILUS_TYPE_QUERY,
G_PARAM_READWRITE));
/**
* NautilusView::extensions-background-menu:
*
* Menu for the background click of extensions
*/
g_object_interface_install_property (iface,
g_param_spec_object ("extensions-background-menu",
"Menu for the background click of extensions",
"Menu for the background click of extensions",
G_TYPE_MENU,
G_PARAM_READWRITE));
/**
* NautilusView::templates-menu:
*
* Menu of templates
*/
g_object_interface_install_property (iface,
g_param_spec_object ("templates-menu",
"Menu of templates",
"Menu of templates",
G_TYPE_MENU,
G_PARAM_READWRITE));
}
/**
......@@ -148,6 +171,42 @@ nautilus_view_get_toolbar_menu_sections (NautilusView *view)
return NAUTILUS_VIEW_GET_IFACE (view)->get_toolbar_menu_sections (view);
}
GMenu *
nautilus_view_get_extensions_background_menu (NautilusView *view)
{
g_return_val_if_fail (NAUTILUS_VIEW_GET_IFACE (view)->get_extensions_background_menu, NULL);
return NAUTILUS_VIEW_GET_IFACE (view)->get_extensions_background_menu (view);
}
/* Protected */
void
nautilus_view_set_extensions_background_menu (NautilusView *view,
GMenu *menu)
{
g_return_if_fail (NAUTILUS_VIEW_GET_IFACE (view)->set_extensions_background_menu);
NAUTILUS_VIEW_GET_IFACE (view)->set_extensions_background_menu (view, menu);
}
GMenu *
nautilus_view_get_templates_menu (NautilusView *view)
{
g_return_val_if_fail (NAUTILUS_VIEW_GET_IFACE (view)->get_templates_menu, NULL);
return NAUTILUS_VIEW_GET_IFACE (view)->get_templates_menu (view);
}
/* Protected */
void
nautilus_view_set_templates_menu (NautilusView *view,
GMenu *menu)
{
g_return_if_fail (NAUTILUS_VIEW_GET_IFACE (view)->set_templates_menu);
NAUTILUS_VIEW_GET_IFACE (view)->set_templates_menu (view, menu);
}
/**
* nautilus_view_get_search_query:
* @view: a #NautilusView
......
......@@ -50,6 +50,20 @@ struct _NautilusViewInterface
*/
NautilusToolbarMenuSections * (*get_toolbar_menu_sections) (NautilusView *view);
/*
* Returns the menu for the background click of extensions.
*/
GMenu * (*get_extensions_background_menu) (NautilusView *view);
void (*set_extensions_background_menu) (NautilusView *view,
GMenu *menu);
/*
* Returns the menu for templates.
*/
GMenu * (*get_templates_menu) (NautilusView *view);
void (*set_templates_menu) (NautilusView *view,
GMenu *menu);
/* Current location of the view */
GFile* (*get_location) (NautilusView *view);
void (*set_location) (NautilusView *view,
......@@ -97,4 +111,11 @@ gboolean nautilus_view_is_loading (Nautilus
gboolean nautilus_view_is_searching (NautilusView *view);
G_END_DECLS
\ No newline at end of file
void nautilus_view_set_templates_menu (NautilusView *view,
GMenu *menu);
GMenu* nautilus_view_get_templates_menu (NautilusView *view);
void nautilus_view_set_extensions_background_menu (NautilusView *view,
GMenu *menu);
GMenu* nautilus_view_get_extensions_background_menu (NautilusView *view);
G_END_DECLS
......@@ -54,6 +54,8 @@ enum
PROP_WINDOW,
PROP_ICON,
PROP_TOOLBAR_MENU_SECTIONS,
PROP_EXTENSIONS_BACKGROUND_MENU,
PROP_TEMPLATES_MENU,
PROP_LOADING,
PROP_SEARCHING,
PROP_SELECTION,
......@@ -124,9 +126,15 @@ typedef struct
gboolean tried_mount;
gint view_mode_before_search;
/* Menus */
GMenu *extensions_background_menu;
GMenu *templates_menu;
/* View bindings */
GBinding *searching_binding;
GBinding *selection_binding;
GBinding *extensions_background_menu_binding;
GBinding *templates_menu_binding;
gboolean searching;
GList *selection;
} NautilusWindowSlotPrivate;
......@@ -159,6 +167,12 @@ static void trash_state_changed_cb (NautilusTrashMonitor *monitor,
gboolean is_empty,
gpointer user_data);
static void update_search_information (NautilusWindowSlot *self);
static void real_set_extensions_background_menu (NautilusWindowSlot *self,
GMenu *menu);
static GMenu* real_get_extensions_background_menu (NautilusWindowSlot *self);
static void real_set_templates_menu (NautilusWindowSlot *self,
GMenu *menu);
static GMenu* real_get_templates_menu (NautilusWindowSlot *self);
void
nautilus_window_slot_restore_from_data (NautilusWindowSlot *self,
......@@ -726,6 +740,26 @@ nautilus_window_slot_set_selection (NautilusWindowSlot *self,
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_SELECTION]);
}
static void
real_set_extensions_background_menu (NautilusWindowSlot *self,
GMenu *menu)
{
NautilusWindowSlotPrivate *priv;
priv = nautilus_window_slot_get_instance_private (self);
priv->extensions_background_menu = menu != NULL ? g_object_ref (menu) : NULL;
}
static void
real_set_templates_menu (NautilusWindowSlot *self,
GMenu *menu)
{
NautilusWindowSlotPrivate *priv;
priv = nautilus_window_slot_get_instance_private (self);
priv->templates_menu = menu != NULL ? g_object_ref (menu) : NULL;
}
static void
nautilus_window_slot_set_property (GObject *object,
guint property_id,
......@@ -760,6 +794,18 @@ nautilus_window_slot_set_property (GObject *object,
}
break;
case PROP_EXTENSIONS_BACKGROUND_MENU:
{
real_set_extensions_background_menu (self, g_value_get_object (value));
}
break;
case PROP_TEMPLATES_MENU:
{
real_set_templates_menu (self, g_value_get_object (value));
}
break;
case PROP_SELECTION:
{
nautilus_window_slot_set_selection (self, g_value_get_pointer (value));
......@@ -774,6 +820,44 @@ nautilus_window_slot_set_property (GObject *object,
}
}
static GMenu*
real_get_extensions_background_menu (NautilusWindowSlot *self)
{
NautilusWindowSlotPrivate *priv;
priv = nautilus_window_slot_get_instance_private (self);
return priv->extensions_background_menu;
}
GMenu*
nautilus_window_slot_get_extensions_background_menu (NautilusWindowSlot *self)
{
GMenu *menu = NULL;
g_object_get (self, "extensions-background-menu", &menu, NULL);
return menu;
}
static GMenu*
real_get_templates_menu (NautilusWindowSlot *self)
{
NautilusWindowSlotPrivate *priv;
priv = nautilus_window_slot_get_instance_private (self);
return priv->templates_menu;
}
GMenu*
nautilus_window_slot_get_templates_menu (NautilusWindowSlot *self)
{
GMenu *menu = NULL;
g_object_get (self, "templates-menu", &menu, NULL);
return menu;
}
static void
nautilus_window_slot_get_property (GObject *object,
guint property_id,
......@@ -807,7 +891,19 @@ nautilus_window_slot_get_property (GObject *object,
case PROP_TOOLBAR_MENU_SECTIONS:
{
g_value_set_pointer (value, nautilus_window_slot_get_toolbar_menu_sections (self));
g_value_set_object (value, nautilus_window_slot_get_toolbar_menu_sections (self));
}
break;
case PROP_EXTENSIONS_BACKGROUND_MENU:
{
g_value_set_object (value, real_get_extensions_background_menu (self));
}
break;
case PROP_TEMPLATES_MENU:
{
g_value_set_object (value, real_get_templates_menu (self));
}
break;
......@@ -2879,6 +2975,8 @@ nautilus_window_slot_switch_new_content_view (NautilusWindowSlot *self)
{
g_binding_unbind (priv->searching_binding);
g_binding_unbind (priv->selection_binding);
g_binding_unbind (priv->extensions_background_menu_binding);
g_binding_unbind (priv->templates_menu_binding);
widget = GTK_WIDGET (priv->content_view);
gtk_widget_destroy (widget);
g_object_unref (priv->content_view);
......@@ -2900,8 +2998,16 @@ nautilus_window_slot_switch_new_content_view (NautilusWindowSlot *self)
priv->selection_binding = g_object_bind_property (priv->content_view, "selection",
self, "selection",
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
priv->extensions_background_menu_binding = g_object_bind_property (priv->content_view, "extensions-background-menu",
self, "extensions-background-menu",
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
priv->templates_menu_binding = g_object_bind_property (priv->content_view, "templates-menu",
self, "templates-menu",
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_ICON]);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_TOOLBAR_MENU_SECTIONS]);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_EXTENSIONS_BACKGROUND_MENU]);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_TEMPLATES_MENU]);
}
done:
......@@ -2957,6 +3063,9 @@ nautilus_window_slot_dispose (GObject *object)
g_clear_pointer (&priv->searching_binding, g_binding_unbind);
g_clear_pointer (&priv->selection_binding, g_binding_unbind);
g_clear_pointer (&priv->extensions_background_menu_binding, g_binding_unbind);
g_clear_pointer (&priv->templates_menu_binding, g_binding_unbind);
if (priv->content_view)
{
gtk_widget_destroy (GTK_WIDGET (priv->content_view));
......@@ -3095,6 +3204,20 @@ nautilus_window_slot_class_init (NautilusWindowSlotClass *klass)