[epiphany] ephy-web-view: also fallback to URI as title here
- From: Xan Lopez <xan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] ephy-web-view: also fallback to URI as title here
- Date: Tue, 6 Mar 2012 20:53:12 +0000 (UTC)
commit ea4b04a4c2c5a91387d2339f79c495677c7512cd
Author: Xan Lopez <xan igalia com>
Date: Fri Mar 2 13:45:51 2012 +0100
ephy-web-view: also fallback to URI as title here
embed/ephy-web-view.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 9b43288..6d4aeda 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1068,13 +1068,19 @@ title_changed_cb (WebKitWebView *web_view,
WebKitWebFrame *frame;
EphyBrowseHistory *browse_history = EPHY_BROWSE_HISTORY (ephy_embed_shell_get_global_browse_history (ephy_embed_shell_get_default ()));
+ frame = webkit_web_view_get_main_frame (web_view);
+ uri = webkit_web_frame_get_uri (frame);
+
g_object_get (web_view, "title", &title, NULL);
+ /* Fallback to the URI as title if it's NULL. */
+ if (title == NULL || g_str_equal (title, "")) {
+ g_free (title);
+ title = g_strdup (uri);
+ }
+
ephy_web_view_set_title (EPHY_WEB_VIEW (web_view),
title);
-
- frame = webkit_web_view_get_main_frame (web_view);
- uri = webkit_web_frame_get_uri (frame);
ephy_browse_history_set_page_title (browse_history, uri, title);
g_free (title);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]