[gtk+/places-sidebar] Create the bookmarks manager from the places sidebar
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/places-sidebar] Create the bookmarks manager from the places sidebar
- Date: Mon, 3 Oct 2011 19:48:44 +0000 (UTC)
commit 2662da7f8d505459418c36571a570577ad3a219b
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Oct 3 09:44:46 2011 -0500
Create the bookmarks manager from the places sidebar
Signed-off-by: Federico Mena Quintero <federico gnome org>
gtk/gtkplacessidebar.c | 27 +++++++++++++--------------
1 files changed, 13 insertions(+), 14 deletions(-)
---
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index 8916d3a..68a8095 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -27,6 +27,7 @@
#include "config.h"
#include "gdk/gdkkeysyms.h"
+#include "gtkbookmarksmanager.h"
#include "gtkmarshalers.h"
#include "gtkplacessidebar.h"
#include "gtkscrolledwindow.h"
@@ -44,7 +45,7 @@ struct _GtkPlacesSidebar {
GtkListStore *store;
GtkTreeModel *filter_model;
NautilusWindow *window;
- NautilusBookmarkList *bookmarks;
+ GtkBookmarksManager *bookmarks_manager;
GVolumeMonitor *volume_monitor;
gboolean devices_header_added;
@@ -75,8 +76,6 @@ struct _GtkPlacesSidebar {
GtkPlacesOpenMode go_to_after_mount_open_mode;
GtkTreePath *eject_highlight_path;
-
- guint bookmarks_changed_id;
};
struct _GtkPlacesSidebarClass {
@@ -3007,6 +3006,12 @@ create_volume_monitor (GtkPlacesSidebar *sidebar)
}
static void
+bookmarks_changed_cb (gpointer data)
+{
+ update_places (sidebar);
+}
+
+static void
gtk_places_sidebar_init (GtkPlacesSidebar *sidebar)
{
GtkTreeView *tree_view;
@@ -3016,6 +3021,8 @@ gtk_places_sidebar_init (GtkPlacesSidebar *sidebar)
create_volume_monitor (sidebar);
+ sidebar->bookmarks_manager = _gtk_bookmarks_manager_new (bookmarks_changed_cb, sidebar);
+
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sidebar),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
@@ -3232,10 +3239,9 @@ gtk_places_sidebar_dispose (GObject *object)
sidebar->eject_highlight_path = NULL;
}
- if (sidebar->bookmarks_changed_id != 0) {
- g_signal_handler_disconnect (sidebar->bookmarks,
- sidebar->bookmarks_changed_id);
- sidebar->bookmarks_changed_id = 0;
+ if (sidebar->bookmarks_manager != NULL) {
+ _gtk_bookmarks_manager_free (sidebar->bookmarks_manager);
+ sidebar->bookmarks_manager = NULL;
}
g_clear_object (&sidebar->store);
@@ -3288,13 +3294,6 @@ gtk_places_sidebar_set_parent_window (GtkPlacesSidebar *sidebar,
{
sidebar->window = window;
- sidebar->bookmarks = nautilus_bookmark_list_new ();
-
- sidebar->bookmarks_changed_id =
- g_signal_connect_swapped (sidebar->bookmarks, "changed",
- G_CALLBACK (update_places),
- sidebar);
-
g_signal_connect_swapped (nautilus_preferences, "changed::" NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER,
G_CALLBACK (bookmarks_popup_menu_detach_cb), sidebar);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]