[nautilus/wip/antoniof/gnome-42: 59/72] Revert "general: Use in-tree copy of GtkPlacesSidebar"




commit 1ea02b310d36c9eb9f71cbc46307595646672bdd
Author: António Fernandes <antoniof gnome org>
Date:   Fri Feb 11 19:04:45 2022 +0000

    Revert "general: Use in-tree copy of GtkPlacesSidebar"
    
    This reverts commit 7bf5ab0c73d5027dbe754df34243054a83ffae1b.

 po/POTFILES.in                            |    3 -
 src/gtk/gtk-code-generator.sh             |  106 +-
 src/gtk/nautilusgtkbookmarksmanager.c     |  594 ---
 src/gtk/nautilusgtkbookmarksmanager.h     |   90 -
 src/gtk/nautilusgtkplacessidebar.c        | 5633 -----------------------------
 src/gtk/nautilusgtkplacessidebar.h        |  159 -
 src/gtk/nautilusgtkplacessidebarprivate.h |   60 -
 src/gtk/nautilusgtkplacesview.c           |   46 +-
 src/gtk/nautilusgtkplacesviewprivate.h    |    9 +-
 src/gtk/nautilusgtkplacesviewrow.c        |    8 +
 src/gtk/nautilusgtksidebarrow.c           |  667 ----
 src/gtk/nautilusgtksidebarrow.ui          |   92 -
 src/gtk/nautilusgtksidebarrowprivate.h    |   61 -
 src/meson.build                           |    7 -
 src/nautilus-places-view.c                |    6 +-
 src/nautilus-window.c                     |  115 +-
 src/resources/nautilus.gresource.xml      |    1 -
 src/resources/ui/nautilus-window.ui       |   11 +
 18 files changed, 136 insertions(+), 7532 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 20c36be67..7c1b6a31b 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -98,6 +98,3 @@ src/gtk/nautilusgtkplacesview.c
 src/gtk/nautilusgtkplacesviewrow.c
 src/gtk/nautilusgtkplacesviewrow.ui
 src/gtk/nautilusgtkplacesview.ui
-src/gtk/nautilusgtkbookmarksmanager.c
-src/gtk/nautilusgtkplacessidebar.c
-src/gtk/nautilusgtksidebarrow.ui
diff --git a/src/gtk/gtk-code-generator.sh b/src/gtk/gtk-code-generator.sh
index e6f2ac0d0..147efb3bd 100755
--- a/src/gtk/gtk-code-generator.sh
+++ b/src/gtk/gtk-code-generator.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Fetch the GtkPlaces* files but rename the symbols to avoid symbol clashes
+# Fetch the GtkPlacesView files but rename the symbols to avoid symbol clashes
 # when using the file chooser inside nautilus i.e. when activating the "move to"
 # action.
 # Also remove/add the neccesary bits to make it work inside nautilus
@@ -13,7 +13,6 @@ SUFIX=?h=gtk-3-24
 # by order:
 # type substitution
 # remove marshalers
-# replace GtkTrashMonitor API with NautilusTrashMonitor API
 # add external localization library after the always there config.h
 # and remove the gtk internal P_ and I_ localization, we don't actually
 # want localization of this in nautilus
@@ -21,9 +20,6 @@ SUFIX=?h=gtk-3-24
 # and remove all the other types that get included by the general gtk.h
 # remove the error when including gtk.h
 # load nautilus resources, not gtk resources
-# use local sidebar header instead of private gtk one
-# in-line replace private gtkfilesystem.h helper function
-# ignore shadowed variable which we would treat as compile error
 
 update_file () {
     _source="$1"
@@ -36,86 +32,62 @@ update_file () {
         -e 's/GTK_PLACES_VIEW/NAUTILUS_GTK_PLACES_VIEW/g' \
         -e 's/GTK_TYPE_PLACES_VIEW/NAUTILUS_TYPE_GTK_PLACES_VIEW/g' \
         -e 's/GTK_IS_PLACES_VIEW/NAUTILUS_IS_GTK_PLACES_VIEW/g' \
-        -e 's/G_DECLARE_FINAL_TYPE (NautilusGtkPlacesViewRow, nautilus_gtk_places_view_row, GTK, 
PLACES_VIEW_ROW, GtkListBoxRow/ G_DECLARE_FINAL_TYPE (NautilusGtkPlacesViewRow, nautilus_gtk_places_view_row, 
NAUTILUS, GTK_PLACES_VIEW_ROW, GtkListBoxRow/g' \
-        -e 's/gtkplacessidebar/nautilusgtkplacessidebar/g' \
-        -e 's/gtk_places_sidebar/nautilus_gtk_places_sidebar/g' \
-        -e 's/GtkPlacesSidebar/NautilusGtkPlacesSidebar/g' \
-        -e 's/GTK_PLACES_SIDEBAR/NAUTILUS_GTK_PLACES_SIDEBAR/g' \
-        -e 's/GTK_TYPE_PLACES_SIDEBAR/NAUTILUS_TYPE_GTK_PLACES_SIDEBAR/g' \
-        -e 's/GTK_IS_PLACES_SIDEBAR/NAUTILUS_IS_GTK_PLACES_SIDEBAR/g' \
-        -e 's/GtkPlacesOpen/NautilusGtkPlacesOpen/g' \
-        -e 's/GTK_PLACES_OPEN/NAUTILUS_GTK_PLACES_OPEN/g' \
-        -e 's/gtkbookmarksmanager/nautilusgtkbookmarksmanager/g' \
-        -e 's/gtk_bookmarks_manager/nautilus_gtk_bookmarks_manager/g' \
-        -e 's/GtkBookmarksManager/NautilusGtkBookmarksManager/g' \
-        -e 's/GTK_BOOKMARKS_MANAGER/NAUTILUS_GTK_BOOKMARKS_MANAGER/g' \
-        -e 's/GTK_TYPE_BOOKMARKS_MANAGER/NAUTILUS_TYPE_GTK_BOOKMARKS_MANAGER/g' \
-        -e 's/GTK_IS_BOOKMARKS_MANAGER/NAUTILUS_IS_GTK_BOOKMARKS_MANAGER/g' \
-        -e 's/gtksidebarrow/nautilusgtksidebarrow/g' \
-        -e 's/gtk_sidebar_row/nautilus_gtk_sidebar_row/g' \
-        -e 's/GtkSidebarRow/NautilusGtkSidebarRow/g' \
-        -e 's/GTK_SIDEBAR_ROW/NAUTILUS_GTK_SIDEBAR_ROW/g' \
-        -e 's/GTK_TYPE_SIDEBAR_ROW/NAUTILUS_TYPE_GTK_SIDEBAR_ROW/g' \
-        -e 's/GTK_IS_SIDEBAR_ROW/NAUTILUS_IS_GTK_SIDEBAR_ROW/g' \
-        -e 's/G_DECLARE_FINAL_TYPE (NautilusGtkSidebarRow, nautilus_gtk_sidebar_row, GTK, SIDEBAR_ROW, 
GtkListBoxRow/ G_DECLARE_FINAL_TYPE (NautilusGtkSidebarRow, nautilus_gtk_sidebar_row, NAUTILUS, 
GTK_SIDEBAR_ROW, GtkListBoxRow/g' \
         -e 's/_gtk_marshal_VOID__STRING_STRING/NULL/g' \
         -e '/gtkmarshalers.h/d' \
         -e '/g_signal_set_va_marshaller/,+2d' \
         -e 's/_gtk_marshal_VOID__OBJECT_FLAGS/NULL/g' \
-        -e 's/_gtk_marshal_VOID__OBJECT_POINTER_INT/NULL/g' \
-        -e 's/_gtk_marshal_VOID__OBJECT_OBJECT_OBJECT/NULL/g' \
-        -e 's/_gtk_marshal_INT__OBJECT_OBJECT_POINTER/NULL/g' \
-        -e 's/_gtk_marshal_INT__INT/NULL/g' \
-        -e 's/gtktrashmonitor.h/nautilus-trash-monitor.h/g' \
-        -e 's/GtkTrashMonitor/NautilusTrashMonitor/g' \
-        -e "s/_gtk_trash_monitor_get_icon (\(.*\))/nautilus_trash_monitor_get_symbolic_icon ()/g" \
-        -e "s/_gtk_trash_monitor_get_has_trash (\(.*\))/!nautilus_trash_monitor_is_empty ()/g" \
-        -e 's/_gtk_trash_monitor_get/nautilus_trash_monitor_get/g' \
         -e '/"config.h"/a #include <glib\/gi18n.h>' \
         -e "s/P_(\(.*\))/\1/" \
         -e "s/I_(\(.*\))/\1/" \
         -e '/"config.h"/a #include <gtk\/gtk.h>' \
         -e '/gtktypebuiltins.h/d' \
+        -e '/gtkplacessidebar.h/d' \
         -e '/gtkintl.h/d' \
-        -e '/<gtk\/gtkbox.h>/d' \
-        -e '/"gtkbox\(.*\).h"/d' \
-        -e '/"gtkbu\(.*\).h"/d' \
-        -e '/"gtkc\(.*\).h"/d' \
-        -e '/"gtkd\(.*\).h"/d' \
-        -e '/"gtke\(.*\).h"/d' \
-        -e '/"gtkf\(.*\).h"/d' \
-        -e '/"gtkg\(.*\).h"/d' \
-        -e '/"gtki\(.*\).h"/d' \
-        -e '/"gtkl\(.*\).h"/d' \
-        -e '/"gtkm\(.*\).h"/d' \
-        -e '/"gtkpo\(.*\).h"/d' \
-        -e '/"gtkr\(.*\).h"/d' \
-        -e '/"gtksc\(.*\).h"/d' \
-        -e '/"gtkse\(.*\).h"/d' \
-        -e '/"gtksi\(.*\).h"/d' \
-        -e '/"gtksp\(.*\).h"/d' \
-        -e '/"gtkst\(.*\).h"/d' \
-        -e '/"gtkt\(.*\).h"/d' \
-        -e '/"gtkw\(.*\).h"/d' \
+        -e '/gtkbox.h/d' \
         -e '/#error/d' \
         -e 's/gtk\/libgtk/gnome\/nautilus\/gtk/g' \
-        -e 's/<gtk\/nautilusgtkplacessidebar.h>/"nautilusgtkplacessidebar.h"'/g \
-        -e 's/_gtk_file_info_consider_as_directory (info)/(g_file_info_get_file_type (info) == 
G_FILE_TYPE_DIRECTORY || g_file_info_get_file_type (info) == G_FILE_TYPE_MOUNTABLE || 
g_file_info_get_file_type (info) == G_FILE_TYPE_SHORTCUT)/g' \
-        -e '/#include "nautilus-trash-monitor.h"/a #pragma GCC diagnostic ignored "-Wshadow"' \
         > "${_dest}"
 }
 
 update_file "${URL}/gtkplacesview.c${SUFIX}" "nautilusgtkplacesview.c"
 update_file "${URL}/gtkplacesviewprivate.h${SUFIX}" "nautilusgtkplacesviewprivate.h"
 update_file "${URLUI}/gtkplacesview.ui${SUFIX}" "nautilusgtkplacesview.ui"
-update_file "${URL}/gtkplacessidebar.c${SUFIX}" "nautilusgtkplacessidebar.c"
-update_file "${URL}/gtkplacessidebarprivate.h${SUFIX}" "nautilusgtkplacessidebarprivate.h"
-update_file "${URL}/gtkplacessidebar.h${SUFIX}" "nautilusgtkplacessidebar.h"
-update_file "${URL}/gtkbookmarksmanager.c${SUFIX}" "nautilusgtkbookmarksmanager.c"
-update_file "${URL}/gtkbookmarksmanager.h${SUFIX}" "nautilusgtkbookmarksmanager.h"
+
+# Since comments are not allowed inside the sed line, this is what it will do
+# by order:
+# type substitution
+# use the correct prefixes for type definition
+# add external localization library after the always there config.h
+# and remove the gtk internal P_ and I_ localization, we don't actually
+# want localization of this in nautilus
+# include gtk.h library after the always there config.h
+# and remove all the other types that get included by the general gtk.h
+# remove the error when including gtk.h
+# load nautilus resources, not gtk resources
+update_file () {
+    _source="$1"
+    _dest="$2"
+
+    curl "${_source}" | sed \
+        -e 's/gtkplacesviewrow/nautilusgtkplacesviewrow/g' \
+        -e 's/gtk_places_view_row/nautilus_gtk_places_view_row/g' \
+        -e 's/GtkPlacesViewRow/NautilusGtkPlacesViewRow/g' \
+        -e 's/GTK_PLACES_VIEW_ROW/NAUTILUS_GTK_PLACES_VIEW_ROW/g' \
+        -e 's/GTK_TYPE_PLACES_VIEW_ROW/NAUTILUS_TYPE_GTK_PLACES_VIEW_ROW/g' \
+        -e 's/GTK_IS_PLACES_VIEW_ROW/NAUTILUS_IS_GTK_PLACES_VIEW_ROW/g' \
+        -e 's/G_DECLARE_FINAL_TYPE (NautilusGtkPlacesViewRow, nautilus_gtk_places_view_row, GTK, 
PLACES_VIEW_ROW, GtkListBoxRow/ G_DECLARE_FINAL_TYPE (NautilusGtkPlacesViewRow, nautilus_gtk_places_view_row, 
NAUTILUS, GTK_PLACES_VIEW_ROW, GtkListBoxRow/g' \
+        -e '/"config.h"/a #include <glib\/gi18n.h>' \
+        -e "s/P_(\(.*\))/\1/" \
+        -e "s/I_(\(.*\))/\1/" \
+        -e '/"config.h"/a #include <gtk\/gtk.h>' \
+        -e '/gtksizegroup.h/d' \
+        -e '/gtkwidget.h/d' \
+        -e '/gtklistbox.h/d' \
+        -e '/#error /d' \
+        -e 's/gtk\/libgtk/gnome\/nautilus\/gtk/g' \
+ > "${_dest}"
+}
+
 update_file "${URL}/gtkplacesviewrow.c${SUFIX}" "nautilusgtkplacesviewrow.c"
 update_file "${URL}/gtkplacesviewrowprivate.h${SUFIX}" "nautilusgtkplacesviewrowprivate.h"
 update_file "${URLUI}/gtkplacesviewrow.ui${SUFIX}" "nautilusgtkplacesviewrow.ui"
-update_file "${URL}/gtksidebarrow.c${SUFIX}" "nautilusgtksidebarrow.c"
-update_file "${URL}/gtksidebarrowprivate.h${SUFIX}" "nautilusgtksidebarrowprivate.h"
-update_file "${URLUI}/gtksidebarrow.ui${SUFIX}" "nautilusgtksidebarrow.ui"
diff --git a/src/gtk/nautilusgtkplacesview.c b/src/gtk/nautilusgtkplacesview.c
index 62505c0e1..b38777f2a 100644
--- a/src/gtk/nautilusgtkplacesview.c
+++ b/src/gtk/nautilusgtkplacesview.c
@@ -50,8 +50,8 @@
 struct _NautilusGtkPlacesViewPrivate
 {
   GVolumeMonitor                *volume_monitor;
-  NautilusGtkPlacesOpenFlags             open_flags;
-  NautilusGtkPlacesOpenFlags             current_open_flags;
+  GtkPlacesOpenFlags             open_flags;
+  GtkPlacesOpenFlags             current_open_flags;
 
   GFile                         *server_list_file;
   GFileMonitor                  *server_list_monitor;
@@ -150,14 +150,14 @@ static GParamSpec *properties [LAST_PROP];
 static void
 emit_open_location (NautilusGtkPlacesView      *view,
                     GFile              *location,
-                    NautilusGtkPlacesOpenFlags  open_flags)
+                    GtkPlacesOpenFlags  open_flags)
 {
   NautilusGtkPlacesViewPrivate *priv;
 
   priv = nautilus_gtk_places_view_get_instance_private (view);
 
   if ((open_flags & priv->open_flags) == 0)
-    open_flags = NAUTILUS_GTK_PLACES_OPEN_NORMAL;
+    open_flags = GTK_PLACES_OPEN_NORMAL;
 
   g_signal_emit (view, places_view_signals[OPEN_LOCATION], 0, location, open_flags);
 }
@@ -350,7 +350,7 @@ set_busy_cursor (NautilusGtkPlacesView *view,
 static void
 activate_row (NautilusGtkPlacesView      *view,
               NautilusGtkPlacesViewRow   *row,
-              NautilusGtkPlacesOpenFlags  flags)
+              GtkPlacesOpenFlags  flags)
 {
   NautilusGtkPlacesViewPrivate *priv;
   GVolume *volume;
@@ -1567,7 +1567,7 @@ open_cb (GtkMenuItem      *item,
   NautilusGtkPlacesView *self;
 
   self = NAUTILUS_GTK_PLACES_VIEW (gtk_widget_get_ancestor (GTK_WIDGET (row), 
NAUTILUS_TYPE_GTK_PLACES_VIEW));
-  activate_row (self, row, NAUTILUS_GTK_PLACES_OPEN_NORMAL);
+  activate_row (self, row, GTK_PLACES_OPEN_NORMAL);
 }
 
 static void
@@ -1577,7 +1577,7 @@ open_in_new_tab_cb (GtkMenuItem      *item,
   NautilusGtkPlacesView *self;
 
   self = NAUTILUS_GTK_PLACES_VIEW (gtk_widget_get_ancestor (GTK_WIDGET (row), 
NAUTILUS_TYPE_GTK_PLACES_VIEW));
-  activate_row (self, row, NAUTILUS_GTK_PLACES_OPEN_NEW_TAB);
+  activate_row (self, row, GTK_PLACES_OPEN_NEW_TAB);
 }
 
 static void
@@ -1587,7 +1587,7 @@ open_in_new_window_cb (GtkMenuItem      *item,
   NautilusGtkPlacesView *self;
 
   self = NAUTILUS_GTK_PLACES_VIEW (gtk_widget_get_ancestor (GTK_WIDGET (row), 
NAUTILUS_TYPE_GTK_PLACES_VIEW));
-  activate_row (self, row, NAUTILUS_GTK_PLACES_OPEN_NEW_WINDOW);
+  activate_row (self, row, GTK_PLACES_OPEN_NEW_WINDOW);
 }
 
 static void
@@ -1709,7 +1709,7 @@ build_popup_menu (NautilusGtkPlacesView    *view,
   gtk_widget_show (item);
   gtk_menu_shell_append (GTK_MENU_SHELL (priv->popup_menu), item);
 
-  if (priv->open_flags & NAUTILUS_GTK_PLACES_OPEN_NEW_TAB)
+  if (priv->open_flags & GTK_PLACES_OPEN_NEW_TAB)
     {
       item = gtk_menu_item_new_with_mnemonic (_("Open in New _Tab"));
       g_signal_connect (item,
@@ -1720,7 +1720,7 @@ build_popup_menu (NautilusGtkPlacesView    *view,
       gtk_menu_shell_append (GTK_MENU_SHELL (priv->popup_menu), item);
     }
 
-  if (priv->open_flags & NAUTILUS_GTK_PLACES_OPEN_NEW_WINDOW)
+  if (priv->open_flags & GTK_PLACES_OPEN_NEW_WINDOW)
     {
       item = gtk_menu_item_new_with_mnemonic (_("Open in New _Window"));
       g_signal_connect (item,
@@ -1829,7 +1829,7 @@ on_key_press_event (GtkWidget     *widget,
           GtkWidget *focus_widget;
           GtkWindow *toplevel;
 
-          priv->current_open_flags = NAUTILUS_GTK_PLACES_OPEN_NORMAL;
+          priv->current_open_flags = GTK_PLACES_OPEN_NORMAL;
           toplevel = get_toplevel (GTK_WIDGET (view));
 
           if (!toplevel)
@@ -1841,9 +1841,9 @@ on_key_press_event (GtkWidget     *widget,
             return FALSE;
 
           if ((event->state & modifiers) == GDK_SHIFT_MASK)
-            priv->current_open_flags = NAUTILUS_GTK_PLACES_OPEN_NEW_TAB;
+            priv->current_open_flags = GTK_PLACES_OPEN_NEW_TAB;
           else if ((event->state & modifiers) == GDK_CONTROL_MASK)
-            priv->current_open_flags = NAUTILUS_GTK_PLACES_OPEN_NEW_WINDOW;
+            priv->current_open_flags = GTK_PLACES_OPEN_NEW_WINDOW;
 
           activate_row (view, NAUTILUS_GTK_PLACES_VIEW_ROW (focus_widget), priv->current_open_flags);
 
@@ -1981,7 +1981,7 @@ on_listbox_row_activated (NautilusGtkPlacesView    *view,
   NautilusGtkPlacesViewPrivate *priv;
   GdkEvent *event;
   guint button;
-  NautilusGtkPlacesOpenFlags open_flags;
+  GtkPlacesOpenFlags open_flags;
 
   priv = nautilus_gtk_places_view_get_instance_private (view);
 
@@ -1989,7 +1989,7 @@ on_listbox_row_activated (NautilusGtkPlacesView    *view,
   gdk_event_get_button (event, &button);
 
   if (gdk_event_get_event_type (event) == GDK_BUTTON_RELEASE && button == GDK_BUTTON_MIDDLE)
-    open_flags = NAUTILUS_GTK_PLACES_OPEN_NEW_TAB;
+    open_flags = GTK_PLACES_OPEN_NEW_TAB;
   else
     open_flags = priv->current_open_flags;
 
@@ -2291,7 +2291,7 @@ nautilus_gtk_places_view_class_init (NautilusGtkPlacesViewClass *klass)
    * NautilusGtkPlacesView::open-location:
    * @view: the object which received the signal.
    * @location: (type Gio.File): #GFile to which the caller should switch.
-   * @open_flags: a single value from #NautilusGtkPlacesOpenFlags specifying how the @location
+   * @open_flags: a single value from #GtkPlacesOpenFlags specifying how the @location
    * should be opened.
    *
    * The places view emits this signal when the user selects a location
@@ -2362,7 +2362,7 @@ nautilus_gtk_places_view_class_init (NautilusGtkPlacesViewClass *klass)
                               "Open Flags",
                               "Modes in which the calling application can open locations selected in the 
sidebar",
                               GTK_TYPE_PLACES_OPEN_FLAGS,
-                              NAUTILUS_GTK_PLACES_OPEN_NORMAL,
+                              GTK_PLACES_OPEN_NORMAL,
                               G_PARAM_READWRITE);
 
   g_object_class_install_properties (object_class, LAST_PROP, properties);
@@ -2401,7 +2401,7 @@ nautilus_gtk_places_view_init (NautilusGtkPlacesView *self)
   priv = nautilus_gtk_places_view_get_instance_private (self);
 
   priv->volume_monitor = g_volume_monitor_get ();
-  priv->open_flags = NAUTILUS_GTK_PLACES_OPEN_NORMAL;
+  priv->open_flags = GTK_PLACES_OPEN_NORMAL;
   priv->path_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
   priv->space_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
@@ -2447,14 +2447,14 @@ nautilus_gtk_places_view_new (void)
  * argument will be set to one of the @flags that was passed in
  * nautilus_gtk_places_view_set_open_flags().
  *
- * Passing 0 for @flags will cause #NAUTILUS_GTK_PLACES_OPEN_NORMAL to always be sent
+ * Passing 0 for @flags will cause #GTK_PLACES_OPEN_NORMAL to always be sent
  * to callbacks for the “open-location” signal.
  *
  * Since: 3.18
  */
 void
 nautilus_gtk_places_view_set_open_flags (NautilusGtkPlacesView      *view,
-                                NautilusGtkPlacesOpenFlags  flags)
+                                GtkPlacesOpenFlags  flags)
 {
   NautilusGtkPlacesViewPrivate *priv;
 
@@ -2471,15 +2471,15 @@ nautilus_gtk_places_view_set_open_flags (NautilusGtkPlacesView      *view,
 
 /**
  * nautilus_gtk_places_view_get_open_flags:
- * @view: a #NautilusGtkPlacesSidebar
+ * @view: a #GtkPlacesSidebar
  *
  * Gets the open flags.
  *
- * Returns: the #NautilusGtkPlacesOpenFlags of @view
+ * Returns: the #GtkPlacesOpenFlags of @view
  *
  * Since: 3.18
  */
-NautilusGtkPlacesOpenFlags
+GtkPlacesOpenFlags
 nautilus_gtk_places_view_get_open_flags (NautilusGtkPlacesView *view)
 {
   NautilusGtkPlacesViewPrivate *priv;
diff --git a/src/gtk/nautilusgtkplacesviewprivate.h b/src/gtk/nautilusgtkplacesviewprivate.h
index b821476cf..92f1dd92f 100644
--- a/src/gtk/nautilusgtkplacesviewprivate.h
+++ b/src/gtk/nautilusgtkplacesviewprivate.h
@@ -22,7 +22,6 @@
 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
 #endif
 
-#include "nautilusgtkplacessidebar.h"
 
 G_BEGIN_DECLS
 
@@ -43,9 +42,9 @@ struct _NautilusGtkPlacesViewClass
 
   void     (* open_location)        (NautilusGtkPlacesView          *view,
                                      GFile                  *location,
-                                     NautilusGtkPlacesOpenFlags  open_flags);
+                                     GtkPlacesOpenFlags  open_flags);
 
-  void    (* show_error_message)     (NautilusGtkPlacesSidebar      *sidebar,
+  void    (* show_error_message)     (GtkPlacesSidebar      *sidebar,
                                       const gchar           *primary,
                                       const gchar           *secondary);
 
@@ -62,9 +61,9 @@ struct _NautilusGtkPlacesView
 
 GType              nautilus_gtk_places_view_get_type                      (void) G_GNUC_CONST;
 
-NautilusGtkPlacesOpenFlags nautilus_gtk_places_view_get_open_flags                (NautilusGtkPlacesView     
 *view);
+GtkPlacesOpenFlags nautilus_gtk_places_view_get_open_flags                (NautilusGtkPlacesView      *view);
 void               nautilus_gtk_places_view_set_open_flags                (NautilusGtkPlacesView      *view,
-                                                                  NautilusGtkPlacesOpenFlags  flags);
+                                                                  GtkPlacesOpenFlags  flags);
 
 const gchar*       nautilus_gtk_places_view_get_search_query              (NautilusGtkPlacesView      *view);
 void               nautilus_gtk_places_view_set_search_query              (NautilusGtkPlacesView      *view,
diff --git a/src/gtk/nautilusgtkplacesviewrow.c b/src/gtk/nautilusgtkplacesviewrow.c
index f07dd4e70..121c5823b 100644
--- a/src/gtk/nautilusgtkplacesviewrow.c
+++ b/src/gtk/nautilusgtkplacesviewrow.c
@@ -29,6 +29,14 @@
  * instead of including gtk.h
  */
 #ifdef GTK_COMPILATION
+#include "gtkbutton.h"
+#include "gtkeventbox.h"
+#include "gtkimage.h"
+#include "gtkintl.h"
+#include "gtklabel.h"
+#include "gtkspinner.h"
+#include "gtkstack.h"
+#include "gtktypebuiltins.h"
 #else
 #include <gtk/gtk.h>
 #endif
diff --git a/src/meson.build b/src/meson.build
index a8c650e97..20865fff4 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -62,13 +62,6 @@ libnautilus_sources = [
   'animation/ide-box-theatric.h',
   'animation/ide-cairo.c',
   'animation/ide-cairo.h',
-  'gtk/nautilusgtkbookmarksmanager.c',
-  'gtk/nautilusgtkbookmarksmanager.h',
-  'gtk/nautilusgtkplacessidebar.c',
-  'gtk/nautilusgtkplacessidebarprivate.h',
-  'gtk/nautilusgtkplacessidebar.h',
-  'gtk/nautilusgtksidebarrow.c',
-  'gtk/nautilusgtksidebarrowprivate.h',
   'gtk/nautilusgtkplacesview.c',
   'gtk/nautilusgtkplacesviewprivate.h',
   'gtk/nautilusgtkplacesviewrow.c',
diff --git a/src/nautilus-places-view.c b/src/nautilus-places-view.c
index a2edbfc85..5d4eef9f0 100644
--- a/src/nautilus-places-view.c
+++ b/src/nautilus-places-view.c
@@ -61,9 +61,9 @@ enum
 };
 
 static void
-open_location_cb (NautilusPlacesView         *view,
-                  GFile                      *location,
-                  NautilusGtkPlacesOpenFlags  open_flags)
+open_location_cb (NautilusPlacesView *view,
+                  GFile              *location,
+                  GtkPlacesOpenFlags  open_flags)
 {
     NautilusOpenFlags flags;
     GtkWidget *slot;
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index c69febd7f..f92858bdf 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -47,8 +47,6 @@
 #define DEBUG_FLAG NAUTILUS_DEBUG_WINDOW
 #include "nautilus-debug.h"
 
-#include "gtk/nautilusgtkplacessidebar.h"
-
 #include "nautilus-application.h"
 #include "nautilus-bookmark-list.h"
 #include "nautilus-clipboard.h"
@@ -478,8 +476,8 @@ action_show_current_location_menu (GSimpleAction *action,
 static void
 on_location_changed (NautilusWindow *window)
 {
-    nautilus_gtk_places_sidebar_set_location (NAUTILUS_GTK_PLACES_SIDEBAR (window->places_sidebar),
-                                              nautilus_window_slot_get_location 
(nautilus_window_get_active_slot (window)));
+    gtk_places_sidebar_set_location (GTK_PLACES_SIDEBAR (window->places_sidebar),
+                                     nautilus_window_slot_get_location (nautilus_window_get_active_slot 
(window)));
 }
 
 static void
@@ -879,29 +877,29 @@ setup_side_pane_width (NautilusWindow *window)
 
 /* Callback used when the places sidebar changes location; we need to change the displayed folder */
 static void
-open_location_cb (NautilusWindow             *window,
-                  GFile                      *location,
-                  NautilusGtkPlacesOpenFlags  open_flags)
+open_location_cb (NautilusWindow     *window,
+                  GFile              *location,
+                  GtkPlacesOpenFlags  open_flags)
 {
     NautilusOpenFlags flags;
     NautilusApplication *application;
 
     switch (open_flags)
     {
-        case NAUTILUS_GTK_PLACES_OPEN_NEW_TAB:
+        case GTK_PLACES_OPEN_NEW_TAB:
         {
             flags = NAUTILUS_OPEN_FLAG_NEW_TAB |
                     NAUTILUS_OPEN_FLAG_DONT_MAKE_ACTIVE;
         }
         break;
 
-        case NAUTILUS_GTK_PLACES_OPEN_NEW_WINDOW:
+        case GTK_PLACES_OPEN_NEW_WINDOW:
         {
             flags = NAUTILUS_OPEN_FLAG_NEW_WINDOW;
         }
         break;
 
-        case NAUTILUS_GTK_PLACES_OPEN_NORMAL: /* fall-through */
+        case GTK_PLACES_OPEN_NORMAL: /* fall-through */
         default:
         {
             flags = 0;
@@ -929,10 +927,10 @@ places_sidebar_unmount_operation_cb (NautilusWindow  *window,
 
 /* Callback used when the places sidebar needs us to present an error message */
 static void
-places_sidebar_show_error_message_cb (NautilusGtkPlacesSidebar *sidebar,
-                                      const char               *primary,
-                                      const char               *secondary,
-                                      gpointer                  user_data)
+places_sidebar_show_error_message_cb (GtkPlacesSidebar *sidebar,
+                                      const char       *primary,
+                                      const char       *secondary,
+                                      gpointer          user_data)
 {
     NautilusWindow *window = NAUTILUS_WINDOW (user_data);
 
@@ -940,8 +938,8 @@ places_sidebar_show_error_message_cb (NautilusGtkPlacesSidebar *sidebar,
 }
 
 static void
-places_sidebar_show_other_locations_with_flags (NautilusWindow             *window,
-                                                NautilusGtkPlacesOpenFlags  open_flags)
+places_sidebar_show_other_locations_with_flags (NautilusWindow     *window,
+                                                GtkPlacesOpenFlags  open_flags)
 {
     GFile *location;
 
@@ -953,8 +951,8 @@ places_sidebar_show_other_locations_with_flags (NautilusWindow             *wind
 }
 
 static void
-places_sidebar_show_starred_location (NautilusWindow             *window,
-                                      NautilusGtkPlacesOpenFlags  open_flags)
+places_sidebar_show_starred_location (NautilusWindow     *window,
+                                      GtkPlacesOpenFlags  open_flags)
 {
     GFile *location;
 
@@ -995,9 +993,9 @@ nautilus_window_start_dnd (NautilusWindow *window,
 {
     g_return_if_fail (NAUTILUS_IS_WINDOW (window));
 
-    nautilus_gtk_places_sidebar_set_drop_targets_visible (NAUTILUS_GTK_PLACES_SIDEBAR 
(window->places_sidebar),
-                                                          TRUE,
-                                                          context);
+    gtk_places_sidebar_set_drop_targets_visible (GTK_PLACES_SIDEBAR (window->places_sidebar),
+                                                 TRUE,
+                                                 context);
 }
 
 void
@@ -1006,18 +1004,18 @@ nautilus_window_end_dnd (NautilusWindow *window,
 {
     g_return_if_fail (NAUTILUS_IS_WINDOW (window));
 
-    nautilus_gtk_places_sidebar_set_drop_targets_visible (NAUTILUS_GTK_PLACES_SIDEBAR 
(window->places_sidebar),
-                                                          FALSE,
-                                                          context);
+    gtk_places_sidebar_set_drop_targets_visible (GTK_PLACES_SIDEBAR (window->places_sidebar),
+                                                 FALSE,
+                                                 context);
 }
 
 /* Callback used when the places sidebar needs to know the drag action to suggest */
 static GdkDragAction
-places_sidebar_drag_action_requested_cb (NautilusGtkPlacesSidebar *sidebar,
-                                         GdkDragContext           *context,
-                                         GFile                    *dest_file,
-                                         GList                    *source_file_list,
-                                         gpointer                  user_data)
+places_sidebar_drag_action_requested_cb (GtkPlacesSidebar *sidebar,
+                                         GdkDragContext   *context,
+                                         GFile            *dest_file,
+                                         GList            *source_file_list,
+                                         gpointer          user_data)
 {
     GList *items;
     char *uri;
@@ -1058,9 +1056,9 @@ out:
 
 /* Callback used when the places sidebar needs us to pop up a menu with possible drag actions */
 static GdkDragAction
-places_sidebar_drag_action_ask_cb (NautilusGtkPlacesSidebar *sidebar,
-                                   GdkDragAction             actions,
-                                   gpointer                  user_data)
+places_sidebar_drag_action_ask_cb (GtkPlacesSidebar *sidebar,
+                                   GdkDragAction     actions,
+                                   gpointer          user_data)
 {
     return nautilus_drag_drop_action_ask (GTK_WIDGET (sidebar), actions);
 }
@@ -1087,11 +1085,11 @@ build_uri_list_from_gfile_list (GList *file_list)
 
 /* Callback used when the places sidebar has URIs dropped into it.  We do a normal file operation for them. 
*/
 static void
-places_sidebar_drag_perform_drop_cb (NautilusGtkPlacesSidebar *sidebar,
-                                     GFile                    *dest_file,
-                                     GList                    *source_file_list,
-                                     GdkDragAction             action,
-                                     gpointer                  user_data)
+places_sidebar_drag_perform_drop_cb (GtkPlacesSidebar *sidebar,
+                                     GFile            *dest_file,
+                                     GList            *source_file_list,
+                                     GdkDragAction     action,
+                                     gpointer          user_data)
 {
     char *dest_uri;
     GList *source_uri_list;
@@ -1244,11 +1242,11 @@ add_menu_separator (GtkWidget *menu)
 }
 
 static void
-places_sidebar_populate_popup_cb (NautilusGtkPlacesSidebar *sidebar,
-                                  GtkWidget                *menu,
-                                  GFile                    *selected_file,
-                                  GVolume                  *selected_volume,
-                                  gpointer                  user_data)
+places_sidebar_populate_popup_cb (GtkPlacesSidebar *sidebar,
+                                  GtkWidget        *menu,
+                                  GFile            *selected_file,
+                                  GVolume          *selected_volume,
+                                  gpointer          user_data)
 {
     NautilusWindow *window = NAUTILUS_WINDOW (user_data);
     GFile *trash;
@@ -1325,10 +1323,10 @@ nautilus_window_set_up_sidebar (NautilusWindow *window)
                       G_CALLBACK (side_pane_notify_position_callback),
                       window);
 
-    nautilus_gtk_places_sidebar_set_open_flags (NAUTILUS_GTK_PLACES_SIDEBAR (window->places_sidebar),
-                                                (NAUTILUS_GTK_PLACES_OPEN_NORMAL
-                                                 | NAUTILUS_GTK_PLACES_OPEN_NEW_TAB
-                                                 | NAUTILUS_GTK_PLACES_OPEN_NEW_WINDOW));
+    gtk_places_sidebar_set_open_flags (GTK_PLACES_SIDEBAR (window->places_sidebar),
+                                       (GTK_PLACES_OPEN_NORMAL
+                                        | GTK_PLACES_OPEN_NEW_TAB
+                                        | GTK_PLACES_OPEN_NEW_WINDOW));
 
     g_signal_connect_swapped (window->places_sidebar, "open-location",
                               G_CALLBACK (open_location_cb), window);
@@ -2701,27 +2699,6 @@ nautilus_window_init (NautilusWindow *window)
     g_type_ensure (NAUTILUS_TYPE_NOTEBOOK);
     gtk_widget_init_template (GTK_WIDGET (window));
 
-    window->places_sidebar = nautilus_gtk_places_sidebar_new ();
-    g_object_set (window->places_sidebar,
-                  "vexpand", TRUE,
-                  "visible", TRUE,
-                  "populate-all", TRUE,
-                  "show-other-locations", TRUE,
-                  "show-starred-location", TRUE,
-                  NULL);
-    gtk_box_append (GTK_BOX (window->sidebar), window->places_sidebar);
-
-    g_signal_connect_object (window->places_sidebar,
-                             "show-other-locations-with-flags",
-                             G_CALLBACK (places_sidebar_show_other_locations_with_flags),
-                             window,
-                             G_CONNECT_SWAPPED);
-    g_signal_connect_object (window->places_sidebar,
-                             "show-starred-location",
-                             G_CALLBACK (places_sidebar_show_starred_location),
-                             window,
-                             G_CONNECT_SWAPPED);
-
     g_signal_connect (window, "notify::is-maximized",
                       G_CALLBACK (on_is_maximized_changed), NULL);
 
@@ -2799,6 +2776,7 @@ nautilus_window_class_init (NautilusWindowClass *class)
     gtk_widget_class_bind_template_child (wclass, NautilusWindow, toolbar);
     gtk_widget_class_bind_template_child (wclass, NautilusWindow, content_paned);
     gtk_widget_class_bind_template_child (wclass, NautilusWindow, sidebar);
+    gtk_widget_class_bind_template_child (wclass, NautilusWindow, places_sidebar);
     gtk_widget_class_bind_template_child (wclass, NautilusWindow, main_view);
     gtk_widget_class_bind_template_child (wclass, NautilusWindow, notebook);
     gtk_widget_class_bind_template_child (wclass, NautilusWindow, in_app_notification_undo);
@@ -2810,6 +2788,9 @@ nautilus_window_class_init (NautilusWindowClass *class)
     gtk_widget_class_bind_template_child (wclass, NautilusWindow, notification_operation_open);
     gtk_widget_class_bind_template_child (wclass, NautilusWindow, notification_operation_close);
 
+    gtk_widget_class_bind_template_callback (wclass, places_sidebar_show_other_locations_with_flags);
+    gtk_widget_class_bind_template_callback (wclass, places_sidebar_show_starred_location);
+
     signals[SLOT_ADDED] =
         g_signal_new ("slot-added",
                       G_TYPE_FROM_CLASS (class),
diff --git a/src/resources/nautilus.gresource.xml b/src/resources/nautilus.gresource.xml
index d27f7b5ff..9e129b669 100644
--- a/src/resources/nautilus.gresource.xml
+++ b/src/resources/nautilus.gresource.xml
@@ -26,7 +26,6 @@
     <file>ui/nautilus-files-view-select-items.ui</file>
     <file>ui/nautilus-operations-ui-manager-request-passphrase.ui</file>
     <file>ui/nautilus-view-icon-item-ui.ui</file>
-    <file alias="gtk/ui/nautilusgtksidebarrow.ui">../gtk/nautilusgtksidebarrow.ui</file>
     <file alias="gtk/ui/nautilusgtkplacesview.ui">../gtk/nautilusgtkplacesview.ui</file>
     <file alias="gtk/ui/nautilusgtkplacesviewrow.ui">../gtk/nautilusgtkplacesviewrow.ui</file>
     <file alias="icons/filmholes.png">../../icons/filmholes.png</file>
diff --git a/src/resources/ui/nautilus-window.ui b/src/resources/ui/nautilus-window.ui
index 407014ecc..853a693ca 100644
--- a/src/resources/ui/nautilus-window.ui
+++ b/src/resources/ui/nautilus-window.ui
@@ -20,6 +20,17 @@
                 <property name="visible">False</property>
                 <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
+                <child>
+                  <object class="GtkPlacesSidebar" id="places_sidebar">
+                    <property name="vexpand">True</property>
+                    <property name="visible">True</property>
+                    <property name="populate-all">True</property>
+                    <property name="show-other-locations">True</property>
+                    <property name="show-starred-location">True</property>
+                    <signal name="show-other-locations-with-flags" 
handler="places_sidebar_show_other_locations_with_flags" object="NautilusWindow" swapped="yes" />
+                    <signal name="show-starred-location" handler="places_sidebar_show_starred_location" 
object="NautilusWindow" swapped="yes" />
+                  </object>
+                </child>
               </object>
               <packing>
                <property name="resize">False</property>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]