[epiphany: 9/14] ephy-web-view: let EphyWebView clear its own history



commit 9d0c171675a92fb30e8bc45f73a513e5dc86912e
Author: Xan Lopez <xan igalia com>
Date:   Wed Mar 14 12:35:15 2012 +0100

    ephy-web-view: let EphyWebView clear its own history
    
    No point in doing it from EphyEmbed.

 embed/ephy-embed.c    |   15 ---------------
 embed/ephy-web-view.c |   15 +++++++++++++++
 2 files changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index f1c4c87..e78b14f 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -381,13 +381,6 @@ zoom_changed_cb (WebKitWebView *web_view,
 }
 
 static void
-ephy_embed_history_cleared_cb (EphyHistoryService *history_service,
-                               EphyEmbed *embed)
-{
-  ephy_web_view_clear_history (EPHY_WEB_VIEW (embed->priv->web_view));
-}
-
-static void
 ephy_embed_grab_focus (GtkWidget *widget)
 {
   GtkWidget *child;
@@ -465,10 +458,6 @@ ephy_embed_finalize (GObject *object)
   }
   g_slist_free (priv->destroy_on_transition_list);
 
-  g_signal_handlers_disconnect_by_func (priv->history_service,
-                                        ephy_embed_history_cleared_cb,
-                                        embed);
-
   for (list = priv->messages; list; list = list->next) {
     EphyEmbedStatusbarMsg *msg;
 
@@ -842,10 +831,6 @@ ephy_embed_constructed (GObject *object)
 
   priv->history_service = EPHY_HISTORY_SERVICE (ephy_embed_shell_get_global_history_service (ephy_embed_shell_get_default ()));
   priv->history_service_cancellable = g_cancellable_new ();
-
-  g_signal_connect (priv->history_service,
-                    "cleared", G_CALLBACK (ephy_embed_history_cleared_cb),
-                    embed);
 }
 
 static void
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 9158071..5759eab 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1035,10 +1035,21 @@ _ephy_web_view_hook_into_links (EphyWebView *web_view)
 }
 
 static void
+ephy_web_view_history_cleared_cb (EphyHistoryService *history_service,
+                                  EphyWebView *view)
+{
+  ephy_web_view_clear_history (view);
+}
+
+static void
 ephy_web_view_finalize (GObject *object)
 {
   EphyWebViewPrivate *priv = EPHY_WEB_VIEW (object)->priv;
 
+  g_signal_handlers_disconnect_by_func (priv->history_service,
+                                        ephy_web_view_history_cleared_cb,
+                                        EPHY_WEB_VIEW (object));
+
   if (priv->icon != NULL) {
     g_object_unref (priv->icon);
     priv->icon = NULL;
@@ -2225,6 +2236,10 @@ ephy_web_view_init (EphyWebView *web_view)
 
   priv->history_service = EPHY_HISTORY_SERVICE (ephy_embed_shell_get_global_history_service (embed_shell));
 
+  g_signal_connect (priv->history_service,
+                    "cleared", G_CALLBACK (ephy_web_view_history_cleared_cb),
+                    web_view);
+
   g_signal_connect (web_view, "mime-type-policy-decision-requested",
                     G_CALLBACK (mime_type_policy_decision_requested_cb),
                     NULL);



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