From 56331a4c43618e7968c219e8b32a0983c5eb6d08 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Tue, 4 Dec 2012 16:16:49 -0600 Subject: [PATCH] Port code to add a bookmark for a volume Signed-off-by: Federico Mena Quintero --- gtk/gtkplacessidebar.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index 754114bcdf..62b24f5ef0 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -2089,17 +2089,16 @@ open_shortcut_in_new_tab_cb (GtkMenuItem *item, open_shortcut_from_menu (sidebar, GTK_PLACES_OPEN_MODE_NEW_TAB); } -/* Add bookmark for the selected item */ +/* Add bookmark for the selected item - just used from mount points */ static void -add_bookmark (GtkPlacesSidebar *sidebar) +add_shortcut_cb (GtkMenuItem *item, + GtkPlacesSidebar *sidebar) { -#if DO_NOT_COMPILE GtkTreeModel *model; GtkTreeIter iter; char *uri; char *name; GFile *location; - NautilusBookmark *bookmark; model = gtk_tree_view_get_model (sidebar->tree_view); @@ -2114,25 +2113,13 @@ add_bookmark (GtkPlacesSidebar *sidebar) } location = g_file_new_for_uri (uri); - bookmark = nautilus_bookmark_new (location, name); - - if (!nautilus_bookmark_list_contains (sidebar->bookmarks, bookmark)) { - nautilus_bookmark_list_append (sidebar->bookmarks, bookmark); - } + if (_gtk_bookmarks_manager_insert_bookmark (sidebar->bookmarks_manager, location, -1, NULL)) + _gtk_bookmarks_manager_set_bookmark_label (sidebar->bookmarks_manager, location, name, NULL); g_object_unref (location); - g_object_unref (bookmark); g_free (uri); g_free (name); } -#endif -} - -static void -add_shortcut_cb (GtkMenuItem *item, - GtkPlacesSidebar *sidebar) -{ - add_bookmark (sidebar); } /* Rename the selected bookmark */