diff options
author | Neil Herald <neil.herald@gmail.com> | 2016-06-19 19:34:06 +0100 |
---|---|---|
committer | Neil Herald <neil.herald@gmail.com> | 2016-06-23 22:45:06 +0100 |
commit | a312f5652756cda481f0808ed94116ae0f5eabda (patch) | |
tree | ce0bb4e3688c1f94d87d0ffe85174ba880ad587c /src/nautilus-places-view.c | |
parent | 35f10147ccafd7ddea63e544aacfae81ae0d554e (diff) | |
download | nautilus-a312f5652756cda481f0808ed94116ae0f5eabda.tar.gz |
toolbar: move undo/redo toolbar menu code into toolbarwip/neilh/toolbar-reorg
Due to the toolbar menu reorganisation work, the code to create and
manage the undo/redo items on the menu ended up in files-view.c. This
isn't the correct place as they don't have much to do with the files
view. Some refactoring was needed before the code for these items could
be moved back into the toolbar, which has now been done in a previous
commit.
This commit moves the undo/redo creation and management code into the
toolbar.
https://bugzilla.gnome.org/show_bug.cgi?id=764632
Diffstat (limited to 'src/nautilus-places-view.c')
-rw-r--r-- | src/nautilus-places-view.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/nautilus-places-view.c b/src/nautilus-places-view.c index dfe5a7fb9..4b79da886 100644 --- a/src/nautilus-places-view.c +++ b/src/nautilus-places-view.c @@ -20,15 +20,17 @@ #include "nautilus-places-view.h" #include "nautilus-window-slot.h" #include "nautilus-application.h" +#include "nautilus-toolbar-menu-sections.h" #include "gtk/nautilusgtkplacesviewprivate.h" typedef struct { - GFile *location; - GIcon *icon; - NautilusQuery *search_query; + GFile *location; + GIcon *icon; + NautilusQuery *search_query; + NautilusToolbarMenuSections *toolbar_menu_sections; - GtkWidget *places_view; + GtkWidget *places_view; } NautilusPlacesViewPrivate; struct _NautilusPlacesView @@ -135,6 +137,8 @@ nautilus_places_view_finalize (GObject *object) g_clear_object (&priv->location); g_clear_object (&priv->search_query); + g_free (priv->toolbar_menu_sections); + G_OBJECT_CLASS (nautilus_places_view_parent_class)->finalize (object); } @@ -278,8 +282,11 @@ nautilus_places_view_set_search_query (NautilusView *view, static NautilusToolbarMenuSections * nautilus_places_view_get_toolbar_menu_sections (NautilusView *view) { - /* By returning NULL, no sections will be added to the toolbar menu when this view is active */ - return NULL; + NautilusPlacesViewPrivate *priv; + + priv = nautilus_places_view_get_instance_private (NAUTILUS_PLACES_VIEW (view)); + + return priv->toolbar_menu_sections; } static gboolean @@ -370,6 +377,9 @@ nautilus_places_view_init (NautilusPlacesView *self) G_CALLBACK (show_error_message_cb), self); + /* Toolbar menu */ + priv->toolbar_menu_sections = g_new0 (NautilusToolbarMenuSections, 1); + priv->toolbar_menu_sections->supports_undo_redo = FALSE; } NautilusPlacesView * |