diff options
author | Xan Lopez <xan@igalia.com> | 2012-06-28 19:30:35 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-06-28 19:30:35 +0800 |
commit | e28f57bde15eebfc46e238de768298134653fde3 (patch) | |
tree | fd7bd6d310cdfd753f1941822b471128bebad733 /embed/ephy-web-view.c | |
parent | b4d5a8daa7fede8dc03d6765c2ac55ea71d0a385 (diff) | |
download | gsoc2013-epiphany-e28f57bde15eebfc46e238de768298134653fde3.tar.gz gsoc2013-epiphany-e28f57bde15eebfc46e238de768298134653fde3.tar.zst gsoc2013-epiphany-e28f57bde15eebfc46e238de768298134653fde3.zip |
ephy-web-view: make set_address completely private
It's not used outside its own class either, so we can make it private
to the file.
Diffstat (limited to 'embed/ephy-web-view.c')
-rw-r--r-- | embed/ephy-web-view.c | 78 |
1 files changed, 37 insertions, 41 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index 9291ba0cb..8c61e40dc 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -1148,6 +1148,43 @@ title_changed_cb (WebKitWebView *web_view, } static void +_ephy_web_view_set_is_blank (EphyWebView *view, + gboolean is_blank) +{ + EphyWebViewPrivate *priv = view->priv; + + if (priv->is_blank != is_blank) { + priv->is_blank = is_blank; + g_object_notify (G_OBJECT (view), "is-blank"); + } +} + +/** + * Sets the view location to be address. Note that this function might + * also set the typed-address property to %NULL. + */ +static void +ephy_web_view_set_address (EphyWebView *view, + const char *address) +{ + EphyWebViewPrivate *priv = view->priv; + GObject *object = G_OBJECT (view); + gboolean is_blank; + + g_free (priv->address); + priv->address = g_strdup (address); + + is_blank = address == NULL || + strcmp (address, "about:blank") == 0; + _ephy_web_view_set_is_blank (view, is_blank); + + if (ephy_web_view_is_loading (view) && priv->typed_address != NULL) + ephy_web_view_set_typed_address (view, NULL); + + g_object_notify (object, "address"); +} + +static void uri_changed_cb (WebKitWebView *web_view, GParamSpec *spec, gpointer data) @@ -3058,47 +3095,6 @@ ephy_web_view_copy_back_history (EphyWebView *source, #endif } -static void -_ephy_web_view_set_is_blank (EphyWebView *view, - gboolean is_blank) -{ - EphyWebViewPrivate *priv = view->priv; - - if (priv->is_blank != is_blank) { - priv->is_blank = is_blank; - g_object_notify (G_OBJECT (view), "is-blank"); - } -} - -/** - * ephy_web_view_set_address: - * @view: an #EphyWebView - * @address: address to set @view to - * - * Sets @view location to be @address. Note that this function might also set - * the typed-address property to %NULL. - */ -void -ephy_web_view_set_address (EphyWebView *view, - const char *address) -{ - EphyWebViewPrivate *priv = view->priv; - GObject *object = G_OBJECT (view); - gboolean is_blank; - - g_free (priv->address); - priv->address = g_strdup (address); - - is_blank = address == NULL || - strcmp (address, "about:blank") == 0; - _ephy_web_view_set_is_blank (view, is_blank); - - if (ephy_web_view_is_loading (view) && priv->typed_address != NULL) - ephy_web_view_set_typed_address (view, NULL); - - g_object_notify (object, "address"); -} - /** * ephy_web_view_set_title: * @view: an #EphyWebView |