aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-03-02 20:45:51 +0800
committerXan Lopez <xan@igalia.com>2012-03-07 04:49:45 +0800
commitea4b04a4c2c5a91387d2339f79c495677c7512cd (patch)
treeba5abd60e0d4f1c41a3c204b913491355f23bb30 /embed
parentdb950819b20f292a36d68dac06c72030bbe17fa3 (diff)
downloadgsoc2013-epiphany-ea4b04a4c2c5a91387d2339f79c495677c7512cd.tar
gsoc2013-epiphany-ea4b04a4c2c5a91387d2339f79c495677c7512cd.tar.gz
gsoc2013-epiphany-ea4b04a4c2c5a91387d2339f79c495677c7512cd.tar.bz2
gsoc2013-epiphany-ea4b04a4c2c5a91387d2339f79c495677c7512cd.tar.lz
gsoc2013-epiphany-ea4b04a4c2c5a91387d2339f79c495677c7512cd.tar.xz
gsoc2013-epiphany-ea4b04a4c2c5a91387d2339f79c495677c7512cd.tar.zst
gsoc2013-epiphany-ea4b04a4c2c5a91387d2339f79c495677c7512cd.zip
ephy-web-view: also fallback to URI as title here
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-web-view.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 9b432885c..6d4aedaa1 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);