[epiphany] ephy-web-view: set_title can also be made private to its file
- From: Xan Lopez <xan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] ephy-web-view: set_title can also be made private to its file
- Date: Thu, 28 Jun 2012 11:45:02 +0000 (UTC)
commit 1a61db4aa5839d921f96727c3c464f6b026221c4
Author: Xan Lopez <xan igalia com>
Date: Thu Jun 28 13:44:22 2012 +0200
ephy-web-view: set_title can also be made private to its file
embed/ephy-web-view.c | 87 ++++++++++++++++++++++--------------------------
embed/ephy-web-view.h | 2 -
2 files changed, 40 insertions(+), 49 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 91ba2ae..51509b1 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1117,6 +1117,46 @@ get_title_from_address (const char *address)
}
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");
+ }
+}
+
+static void
+ephy_web_view_set_title (EphyWebView *view,
+ const char *view_title)
+{
+ EphyWebViewPrivate *priv = view->priv;
+ char *title = g_strdup (view_title);
+
+ if (!priv->is_blank && (title == NULL || g_strstrip (title)[0] == '\0')) {
+ g_free (title);
+ title = get_title_from_address (priv->address);
+
+ /* Fallback */
+ if (title == NULL || title[0] == '\0') {
+ g_free (title);
+ title = g_strdup (EMPTY_PAGE);
+ _ephy_web_view_set_is_blank (view, TRUE);
+ }
+ } else if (priv->is_blank) {
+ g_free (title);
+ title = g_strdup (EMPTY_PAGE);
+ }
+
+ g_free (priv->title);
+ priv->title = ephy_string_shorten (title, MAX_TITLE_LENGTH);
+
+ g_object_notify (G_OBJECT (view), "embed-title");
+}
+
+static void
title_changed_cb (WebKitWebView *web_view,
GParamSpec *spec,
gpointer data)
@@ -1147,18 +1187,6 @@ 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.
@@ -3087,41 +3115,6 @@ ephy_web_view_copy_back_history (EphyWebView *source,
}
/**
- * ephy_web_view_set_title:
- * @view: an #EphyWebView
- * @view_title: new title for @view
- *
- * Sets @view title to @view_title.
- */
-void
-ephy_web_view_set_title (EphyWebView *view,
- const char *view_title)
-{
- EphyWebViewPrivate *priv = view->priv;
- char *title = g_strdup (view_title);
-
- if (!priv->is_blank && (title == NULL || g_strstrip (title)[0] == '\0')) {
- g_free (title);
- title = get_title_from_address (priv->address);
-
- /* Fallback */
- if (title == NULL || title[0] == '\0') {
- g_free (title);
- title = g_strdup (EMPTY_PAGE);
- _ephy_web_view_set_is_blank (view, TRUE);
- }
- } else if (priv->is_blank) {
- g_free (title);
- title = g_strdup (EMPTY_PAGE);
- }
-
- g_free (priv->title);
- priv->title = ephy_string_shorten (title, MAX_TITLE_LENGTH);
-
- g_object_notify (G_OBJECT (view), "embed-title");
-}
-
-/**
* ephy_web_view_get_is_blank:
* @view: an #EphyWebView
*
diff --git a/embed/ephy-web-view.h b/embed/ephy-web-view.h
index a1147ed..41b59f8 100644
--- a/embed/ephy-web-view.h
+++ b/embed/ephy-web-view.h
@@ -160,8 +160,6 @@ void ephy_web_view_get_security_level (EphyWebView
EphyWebViewSecurityLevel *level,
char **description);
void ephy_web_view_print (EphyWebView *view);
-void ephy_web_view_set_title (EphyWebView *view,
- const char *view_title);
const char * ephy_web_view_get_title (EphyWebView *view);
const char * ephy_web_view_get_address (EphyWebView *view);
const char * ephy_web_view_get_title_composite (EphyWebView *view);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]