[epiphany/wip/bookmarks: 312/315] Remove obsolete EphyBookmarksUi



commit c421ff0c1f4ff9c6ac0fab98eb7931fce45afc09
Author: Iulian Radu <iulian radu67 gmail com>
Date:   Tue Sep 27 19:13:04 2016 +0300

    Remove obsolete EphyBookmarksUi

 src/bookmarks/Makefile.am         |    4 +-
 src/bookmarks/ephy-bookmarks-ui.c |   97 -------------------------------------
 src/bookmarks/ephy-bookmarks-ui.h |   59 ----------------------
 src/ephy-history-window.c         |   29 -----------
 src/ephy-window.c                 |    6 --
 src/popup-commands.c              |   27 ----------
 src/popup-commands.h              |    3 -
 src/resources/history-dialog.ui   |    4 --
 src/window-commands.c             |    1 -
 9 files changed, 1 insertions(+), 229 deletions(-)
---
diff --git a/src/bookmarks/Makefile.am b/src/bookmarks/Makefile.am
index 8a1ea3f..1c00b5c 100644
--- a/src/bookmarks/Makefile.am
+++ b/src/bookmarks/Makefile.am
@@ -5,9 +5,7 @@ TYPES_H_FILES = \
 
 libephybookmarks_la_SOURCES =          \
        ephy-bookmarks.c                \
-       ephy-bookmarks.h                \
-       ephy-bookmarks-ui.c             \
-       ephy-bookmarks-ui.h
+       ephy-bookmarks.h
 
 nodist_libephybookmarks_la_SOURCES =   \
        $(BUILT_SOURCES)
diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c
index 1f8502e..f8f86a9 100644
--- a/src/ephy-history-window.c
+++ b/src/ephy-history-window.c
@@ -21,7 +21,6 @@
 #include "config.h"
 #include "ephy-history-window.h"
 
-#include "ephy-bookmarks-ui.h"
 #include "ephy-debug.h"
 #include "ephy-gui.h"
 #include "ephy-prefs.h"
@@ -397,27 +396,6 @@ copy_url (GSimpleAction *action,
 }
 
 static void
-bookmark (GSimpleAction *action,
-          GVariant      *parameter,
-          gpointer       user_data)
-{
-  EphyHistoryWindow *self = EPHY_HISTORY_WINDOW (user_data);
-  GList *selection;
-
-  selection = get_selection (self);
-
-  if (g_list_length (selection) == 1) {
-    EphyHistoryURL *url;
-
-    url = selection->data;
-
-    ephy_bookmarks_ui_add_bookmark (GTK_WINDOW (self), url->url, url->title);
-  }
-
-  g_list_free_full (selection, (GDestroyNotify)ephy_history_url_free);
-}
-
-static void
 forget (GSimpleAction *action,
         GVariant      *parameter,
         gpointer       user_data)
@@ -446,16 +424,10 @@ update_popup_menu_actions (GActionGroup *action_group,
                            gboolean      only_one_selected_item)
 {
   GAction *copy_url_action;
-  GAction *bookmark_action;
-  gboolean bookmarks_locked;
 
   copy_url_action = g_action_map_lookup_action (G_ACTION_MAP (action_group), "copy-url");
-  bookmark_action = g_action_map_lookup_action (G_ACTION_MAP (action_group), "bookmark");
-  bookmarks_locked = g_settings_get_boolean (EPHY_SETTINGS_LOCKDOWN,
-                                             EPHY_PREFS_LOCKDOWN_BOOKMARK_EDITING);
 
   g_simple_action_set_enabled (G_SIMPLE_ACTION (copy_url_action), only_one_selected_item);
-  g_simple_action_set_enabled (G_SIMPLE_ACTION (bookmark_action), (only_one_selected_item && 
!bookmarks_locked));
 }
 
 static gboolean
@@ -773,7 +745,6 @@ create_action_group (EphyHistoryWindow *self)
   const GActionEntry entries[] = {
     { "open-selection", open_selection },
     { "copy-url", copy_url },
-    { "bookmark", bookmark },
     { "forget", forget },
     { "forget-all", forget_all }
   };
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 3bc46a2..c27602b 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -23,7 +23,6 @@
 #include "ephy-window.h"
 
 #include "ephy-action-helper.h"
-#include "ephy-bookmarks-ui.h"
 #include "ephy-bookmarks-manager.h"
 #include "ephy-debug.h"
 #include "ephy-embed-container.h"
@@ -2606,8 +2605,6 @@ ephy_window_dispose (GObject *object)
   if (window->closing == FALSE) {
     window->closing = TRUE;
 
-    ephy_bookmarks_ui_detach_window (window);
-
     _ephy_window_set_context_event (window, NULL);
 
     g_clear_object (&window->bookmarks_manager);
@@ -2974,9 +2971,6 @@ ephy_window_constructed (GObject *object)
                                              GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
   g_object_unref (css_provider);
 
-  /* Initialize the menus */
-  ephy_bookmarks_ui_attach_window (window);
-
   /* other notifiers */
   action_group = gtk_widget_get_action_group (GTK_WIDGET (window), "win");
   new_action = g_action_map_lookup_action (G_ACTION_MAP (action_group),
diff --git a/src/popup-commands.c b/src/popup-commands.c
index 5004a31..74554c3 100644
--- a/src/popup-commands.c
+++ b/src/popup-commands.c
@@ -19,7 +19,6 @@
 #include "config.h"
 #include "popup-commands.h"
 
-#include "ephy-bookmarks-ui.h"
 #include "ephy-downloads-manager.h"
 #include "ephy-embed-container.h"
 #include "ephy-embed-utils.h"
@@ -100,32 +99,6 @@ popup_cmd_media_in_new_window (GSimpleAction *action,
   view_in_destination (EPHY_WINDOW (user_data), "media-uri", NEW_WINDOW);
 }
 
-void
-popup_cmd_bookmark_link (GSimpleAction *action,
-                         GVariant      *parameter,
-                         gpointer       user_data)
-{
-  EphyEmbedEvent *event;
-  WebKitHitTestResult *result;
-  const char *title;
-  const char *location;
-
-  event = ephy_window_get_context_event (EPHY_WINDOW (user_data));
-
-  result = ephy_embed_event_get_hit_test_result (event);
-  if (!webkit_hit_test_result_context_is_link (result)) {
-    return;
-  }
-
-  location = webkit_hit_test_result_get_link_uri (result);
-  title = webkit_hit_test_result_get_link_title (result);
-  if (!title) {
-    title = webkit_hit_test_result_get_link_label (result);
-  }
-
-  ephy_bookmarks_ui_add_bookmark (GTK_WINDOW (user_data), location, title);
-}
-
 static void
 popup_cmd_copy_to_clipboard (EphyWindow *window, const char *text)
 {
diff --git a/src/popup-commands.h b/src/popup-commands.h
index 411b7b2..295cde5 100644
--- a/src/popup-commands.h
+++ b/src/popup-commands.h
@@ -33,9 +33,6 @@ void popup_cmd_link_in_new_tab          (GSimpleAction *action,
 void popup_cmd_link_in_incognito_window (GSimpleAction *action,
                                          GVariant      *parameter,
                                          gpointer       user_data);
-void popup_cmd_bookmark_link            (GSimpleAction *action,
-                                         GVariant      *parameter,
-                                         gpointer       user_data);
 void popup_cmd_view_source              (GSimpleAction *action,
                                          GVariant      *parameter,
                                          gpointer       user_data);
diff --git a/src/resources/history-dialog.ui b/src/resources/history-dialog.ui
index ef6b226..e269c35 100644
--- a/src/resources/history-dialog.ui
+++ b/src/resources/history-dialog.ui
@@ -22,10 +22,6 @@
         <attribute name="action">history.copy-url</attribute>
       </item>
       <item>
-        <attribute name="label" translatable="yes">Add _Bookmark</attribute>
-        <attribute name="action">history.bookmark</attribute>
-      </item>
-      <item>
         <attribute name="label" translatable="yes">_Delete</attribute>
         <attribute name="action">history.forget</attribute>
       </item>
diff --git a/src/window-commands.c b/src/window-commands.c
index ccd4c58..b199e8a 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -24,7 +24,6 @@
 #include "window-commands.h"
 
 #include "ephy-add-bookmark-popover.h"
-#include "ephy-bookmarks-ui.h"
 #include "ephy-debug.h"
 #include "ephy-embed-container.h"
 #include "ephy-embed-prefs.h"


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