diff options
author | Xan Lopez <xan@igalia.com> | 2012-03-02 20:45:51 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-03-07 04:49:45 +0800 |
commit | ea4b04a4c2c5a91387d2339f79c495677c7512cd (patch) | |
tree | ba5abd60e0d4f1c41a3c204b913491355f23bb30 /embed/ephy-web-view.c | |
parent | db950819b20f292a36d68dac06c72030bbe17fa3 (diff) | |
download | gsoc2013-epiphany-ea4b04a4c2c5a91387d2339f79c495677c7512cd.tar.gz gsoc2013-epiphany-ea4b04a4c2c5a91387d2339f79c495677c7512cd.tar.zst gsoc2013-epiphany-ea4b04a4c2c5a91387d2339f79c495677c7512cd.zip |
ephy-web-view: also fallback to URI as title here
Diffstat (limited to 'embed/ephy-web-view.c')
-rw-r--r-- | 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 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); |