[nautilus] bookmarks: remove bookmarks manager
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] bookmarks: remove bookmarks manager
- Date: Wed, 16 Dec 2015 13:15:52 +0000 (UTC)
commit e13b3e2fcd80d5e788e72906b135635f0c148799
Author: Carlos Soriano <csoriano gnome org>
Date: Wed Dec 16 14:01:29 2015 +0100
bookmarks: remove bookmarks manager
Current bookmark manager is mostly a "show the internals in the UI",
with just showing the properties in a text base way.
Users can already accomplish the key functions of the manager through
the sidebar: you can rename, remove, and reorder through drag and drop.
The only thing you can't do with the sidebar is edit the path of a
bookmark, but I would argue that that's problematic anyway (since you
can break bookmarks that way, and it is much less error-prone to
navigate to the location and bookmark it than hand edit a location
field).
The fact that the only way to open the bookmark manager is through a
keyboard shortcut is probably a sign that it isn't really getting used
anyway, and that it isn't worth the trouble of fixing it up.
So remove it and instead, if needed, focus on improving bookmarks
management in the sidebar.
https://bugzilla.gnome.org/show_bug.cgi?id=759504
src/Makefile.am | 2 -
src/nautilus-application-actions.c | 13 -
src/nautilus-application.c | 11 -
src/nautilus-bookmark-list.c | 145 +----
src/nautilus-bookmark-list.h | 11 -
src/nautilus-bookmarks-window.c | 906 -------------------------
src/nautilus-bookmarks-window.h | 63 --
src/nautilus-window.c | 1 -
src/resources/ui/nautilus-bookmarks-window.ui | 318 ---------
9 files changed, 17 insertions(+), 1453 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 44f9780..a70237a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -144,8 +144,6 @@ nautilus_SOURCES = \
nautilus-application-actions.h \
nautilus-bookmark-list.c \
nautilus-bookmark-list.h \
- nautilus-bookmarks-window.c \
- nautilus-bookmarks-window.h \
nautilus-canvas-view.c \
nautilus-canvas-view.h \
nautilus-canvas-view-container.c \
diff --git a/src/nautilus-application-actions.c b/src/nautilus-application-actions.c
index 4682de3..8f6ebae 100644
--- a/src/nautilus-application-actions.c
+++ b/src/nautilus-application-actions.c
@@ -47,17 +47,6 @@ action_new_window (GSimpleAction *action,
}
static void
-action_bookmarks (GSimpleAction *action,
- GVariant *parameter,
- gpointer user_data)
-{
- GtkApplication *application = user_data;
-
- nautilus_application_edit_bookmarks (NAUTILUS_APPLICATION (application),
- NAUTILUS_WINDOW (gtk_application_get_active_window
(application)));
-}
-
-static void
action_preferences (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
@@ -195,7 +184,6 @@ action_show_help_overlay (GSimpleAction *action,
static GActionEntry app_entries[] = {
{ "new-window", action_new_window, NULL, NULL, NULL },
- { "bookmarks", action_bookmarks, NULL, NULL, NULL },
{ "preferences", action_preferences, NULL, NULL, NULL },
{ "show-hide-sidebar", NULL, NULL, "true", action_show_hide_sidebar },
{ "about", action_about, NULL, NULL, NULL },
@@ -233,5 +221,4 @@ nautilus_init_application_actions (NautilusApplication *app)
g_variant_new_boolean (show_sidebar));
nautilus_application_add_accelerator (G_APPLICATION (app), "app.show-hide-sidebar", "F9");
- nautilus_application_add_accelerator (G_APPLICATION (app), "app.bookmarks", "<control>b");
}
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index cba275c..fe298dc 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -30,7 +30,6 @@
#include "nautilus-application.h"
#include "nautilus-application-actions.h"
-#include "nautilus-bookmarks-window.h"
#include "nautilus-dbus-manager.h"
#include "nautilus-desktop-window.h"
#include "nautilus-freedesktop-dbus.h"
@@ -112,16 +111,6 @@ nautilus_application_get_bookmarks (NautilusApplication *application)
return application->priv->bookmark_list;
}
-void
-nautilus_application_edit_bookmarks (NautilusApplication *application,
- NautilusWindow *window)
-{
- GtkWindow *bookmarks_window;
-
- bookmarks_window = nautilus_bookmarks_window_new (window);
- gtk_window_present (bookmarks_window);
-}
-
static gboolean
check_required_directories (NautilusApplication *application)
{
diff --git a/src/nautilus-bookmark-list.c b/src/nautilus-bookmark-list.c
index 3e482c9..b62414a 100644
--- a/src/nautilus-bookmark-list.c
+++ b/src/nautilus-bookmark-list.c
@@ -237,124 +237,6 @@ insert_bookmark_internal (NautilusBookmarkList *bookmarks,
}
/**
- * nautilus_bookmark_list_append:
- *
- * Append a bookmark to a bookmark list.
- * @bookmarks: NautilusBookmarkList to append to.
- * @bookmark: Bookmark to append a copy of.
- **/
-void
-nautilus_bookmark_list_append (NautilusBookmarkList *bookmarks,
- NautilusBookmark *bookmark)
-{
- g_return_if_fail (NAUTILUS_IS_BOOKMARK_LIST (bookmarks));
- g_return_if_fail (NAUTILUS_IS_BOOKMARK (bookmark));
-
- if (g_list_find_custom (bookmarks->list, bookmark,
- nautilus_bookmark_compare_with) != NULL) {
- return;
- }
-
- insert_bookmark_internal (bookmarks, g_object_ref (bookmark), -1);
- nautilus_bookmark_list_save_file (bookmarks);
-}
-
-/**
- * nautilus_bookmark_list_delete_item_at:
- *
- * Delete the bookmark at the specified position.
- * @bookmarks: the list of bookmarks.
- * @index: index, must be less than length of list.
- **/
-void
-nautilus_bookmark_list_delete_item_at (NautilusBookmarkList *bookmarks,
- guint index)
-{
- GList *doomed;
-
- g_return_if_fail (NAUTILUS_IS_BOOKMARK_LIST (bookmarks));
- g_return_if_fail (index < g_list_length (bookmarks->list));
-
- doomed = g_list_nth (bookmarks->list, index);
- bookmarks->list = g_list_remove_link (bookmarks->list, doomed);
-
- g_assert (NAUTILUS_IS_BOOKMARK (doomed->data));
- stop_monitoring_bookmark (bookmarks, NAUTILUS_BOOKMARK (doomed->data));
- g_object_unref (doomed->data);
-
- g_list_free_1 (doomed);
-
- nautilus_bookmark_list_save_file (bookmarks);
-}
-
-/**
- * nautilus_bookmark_list_move_item:
- *
- * Move the item from the given position to the destination.
- * @index: the index of the first bookmark.
- * @destination: the index of the second bookmark.
- **/
-void
-nautilus_bookmark_list_move_item (NautilusBookmarkList *bookmarks,
- guint index,
- guint destination)
-{
- GList *bookmark_item;
-
- if (index == destination) {
- return;
- }
-
- bookmark_item = g_list_nth (bookmarks->list, index);
- bookmarks->list = g_list_remove_link (bookmarks->list,
- bookmark_item);
-
- bookmarks->list = g_list_insert (bookmarks->list,
- bookmark_item->data,
- destination);
-
- nautilus_bookmark_list_save_file (bookmarks);
-}
-
-/**
- * nautilus_bookmark_list_insert_item:
- *
- * Insert a bookmark at a specified position.
- * @bookmarks: the list of bookmarks.
- * @index: the position to insert the bookmark at.
- * @new_bookmark: the bookmark to insert a copy of.
- **/
-void
-nautilus_bookmark_list_insert_item (NautilusBookmarkList *bookmarks,
- NautilusBookmark *new_bookmark,
- guint index)
-{
- g_return_if_fail (NAUTILUS_IS_BOOKMARK_LIST (bookmarks));
- g_return_if_fail (index <= g_list_length (bookmarks->list));
-
- insert_bookmark_internal (bookmarks, g_object_ref (new_bookmark), index);
- nautilus_bookmark_list_save_file (bookmarks);
-}
-
-/**
- * nautilus_bookmark_list_item_at:
- *
- * Get the bookmark at the specified position.
- * @bookmarks: the list of bookmarks.
- * @index: index, must be less than length of list.
- *
- * Return value: the bookmark at position @index in @bookmarks.
- **/
-NautilusBookmark *
-nautilus_bookmark_list_item_at (NautilusBookmarkList *bookmarks, guint index)
-{
- g_return_val_if_fail (NAUTILUS_IS_BOOKMARK_LIST (bookmarks), NULL);
- g_return_val_if_fail (index < g_list_length (bookmarks->list), NULL);
-
- return NAUTILUS_BOOKMARK (g_list_nth_data (bookmarks->list, index));
-}
-
-/**
* nautilus_bookmark_list_item_with_location:
*
* Get the bookmark with the specified location, if any
@@ -404,19 +286,26 @@ nautilus_bookmark_list_item_with_location (NautilusBookmarkList *bookmarks,
}
/**
- * nautilus_bookmark_list_length:
- *
- * Get the number of bookmarks in the list.
- * @bookmarks: the list of bookmarks.
- *
- * Return value: the length of the bookmark list.
+ * nautilus_bookmark_list_append:
+ *
+ * Append a bookmark to a bookmark list.
+ * @bookmarks: NautilusBookmarkList to append to.
+ * @bookmark: Bookmark to append a copy of.
**/
-guint
-nautilus_bookmark_list_length (NautilusBookmarkList *bookmarks)
+void
+nautilus_bookmark_list_append (NautilusBookmarkList *bookmarks,
+ NautilusBookmark *bookmark)
{
- g_return_val_if_fail (NAUTILUS_IS_BOOKMARK_LIST(bookmarks), 0);
+ g_return_if_fail (NAUTILUS_IS_BOOKMARK_LIST (bookmarks));
+ g_return_if_fail (NAUTILUS_IS_BOOKMARK (bookmark));
- return g_list_length (bookmarks->list);
+ if (g_list_find_custom (bookmarks->list, bookmark,
+ nautilus_bookmark_compare_with) != NULL) {
+ return;
+ }
+
+ insert_bookmark_internal (bookmarks, g_object_ref (bookmark), -1);
+ nautilus_bookmark_list_save_file (bookmarks);
}
static void
diff --git a/src/nautilus-bookmark-list.h b/src/nautilus-bookmark-list.h
index 3faf15b..b5bab0b 100644
--- a/src/nautilus-bookmark-list.h
+++ b/src/nautilus-bookmark-list.h
@@ -62,20 +62,9 @@ GType nautilus_bookmark_list_get_type (void);
NautilusBookmarkList * nautilus_bookmark_list_new (void);
void nautilus_bookmark_list_append (NautilusBookmarkList *bookmarks,
NautilusBookmark *bookmark);
-void nautilus_bookmark_list_delete_item_at (NautilusBookmarkList *bookmarks,
- guint index);
-void nautilus_bookmark_list_insert_item (NautilusBookmarkList *bookmarks,
- NautilusBookmark *bookmark,
- guint index);
-guint nautilus_bookmark_list_length (NautilusBookmarkList *bookmarks);
-NautilusBookmark * nautilus_bookmark_list_item_at (NautilusBookmarkList *bookmarks,
- guint index);
NautilusBookmark * nautilus_bookmark_list_item_with_location (NautilusBookmarkList *bookmarks,
GFile *location,
guint *index);
-void nautilus_bookmark_list_move_item (NautilusBookmarkList *bookmarks,
- guint index,
- guint destination);
gboolean nautilus_bookmark_list_can_bookmark_location (NautilusBookmarkList *list,
GFile *location);
GList * nautilus_bookmark_list_get_all (NautilusBookmarkList *bookmarks);
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index a8b5100..830b1cf 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -31,7 +31,6 @@
#include <config.h>
#include "nautilus-application.h"
-#include "nautilus-bookmarks-window.h"
#include "nautilus-desktop-window.h"
#include "nautilus-location-entry.h"
#include "nautilus-mime-actions.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]