[epiphany] ephy-find-toolbar: properly set its webview



commit 48ee65cb97e646f2eccadc29338ef13555fc6208
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Wed Feb 12 21:42:18 2014 +0200

    ephy-find-toolbar: properly set its webview
    
    We were setting the webview twice to the find-bar: upon creation and
    then everytime the notebook switched to the page containing it. However,
    only the second time all the signal handlers related to search
    were connected, and not even properly.
    
    Fix all this mess by using the proper setter() and removing the public
    method, after all the webview property is construct only.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724230

 embed/ephy-find-toolbar.c |   15 ++++-----------
 embed/ephy-find-toolbar.h |    3 ---
 src/ephy-window.c         |    3 ---
 3 files changed, 4 insertions(+), 17 deletions(-)
---
diff --git a/embed/ephy-find-toolbar.c b/embed/ephy-find-toolbar.c
index 819f4fd..1d09a85 100644
--- a/embed/ephy-find-toolbar.c
+++ b/embed/ephy-find-toolbar.c
@@ -85,6 +85,8 @@ G_DEFINE_TYPE (EphyFindToolbar, ephy_find_toolbar, GTK_TYPE_SEARCH_BAR)
 
 /* private functions */
 
+static void ephy_find_toolbar_set_web_view (EphyFindToolbar *toolbar, WebKitWebView *web_view);
+
 static void
 set_status (EphyFindToolbar *toolbar,
            EphyFindResult result)
@@ -345,15 +347,6 @@ entry_activate_cb (GtkWidget *entry,
 }
 
 static void
-_ephy_find_toolbar_set_web_view (EphyFindToolbar *toolbar,
-                                WebKitWebView *web_view)
-{
-       EphyFindToolbarPrivate *priv = toolbar->priv;
-
-       priv->web_view = web_view;
-}
-
-static void
 ephy_find_toolbar_grab_focus (GtkWidget *widget)
 {
        EphyFindToolbar *toolbar = EPHY_FIND_TOOLBAR (widget);
@@ -546,7 +539,7 @@ ephy_find_toolbar_set_property (GObject *object,
        switch (prop_id)
        {
                case PROP_WEB_VIEW:
-                       _ephy_find_toolbar_set_web_view (toolbar, (WebKitWebView *) g_value_get_object 
(value));
+                       ephy_find_toolbar_set_web_view (toolbar, (WebKitWebView *) g_value_get_object 
(value));
                        break;
        }
 }
@@ -635,7 +628,7 @@ ephy_find_toolbar_get_text (EphyFindToolbar *toolbar)
        return gtk_entry_get_text (GTK_ENTRY (priv->entry));
 }
 
-void
+static void
 ephy_find_toolbar_set_web_view (EphyFindToolbar *toolbar,
                                WebKitWebView *web_view)
 {
diff --git a/embed/ephy-find-toolbar.h b/embed/ephy-find-toolbar.h
index 82a441f..62113e7 100644
--- a/embed/ephy-find-toolbar.h
+++ b/embed/ephy-find-toolbar.h
@@ -66,9 +66,6 @@ EphyFindToolbar *ephy_find_toolbar_new                 (WebKitWebView *web_view);
 
 const char     *ephy_find_toolbar_get_text      (EphyFindToolbar *toolbar);
 
-void            ephy_find_toolbar_set_web_view  (EphyFindToolbar *toolbar,
-                                                 WebKitWebView *web_view);
-
 void            ephy_find_toolbar_find_next     (EphyFindToolbar *toolbar);
 
 void            ephy_find_toolbar_find_previous (EphyFindToolbar *toolbar);
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 55fdf89..51556b9 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2793,9 +2793,6 @@ notebook_switch_page_cb (GtkNotebook *notebook,
 
        /* update new tab */
        ephy_window_set_active_tab (window, embed);
-
-       ephy_find_toolbar_set_web_view (ephy_embed_get_find_toolbar (embed),
-                                       EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed));
 }
 
 static GtkNotebook *


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