[epiphany/gnome-3-18] embed: set title properly when empty



commit 44a7e6f32d9a5884105490ee907666158eec35a3
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Sat Feb 20 13:29:20 2016 -0600

    embed: set title properly when empty
    
    Otherwise notebook tabs' labels don't get updated when navigating to a
    page without a title (e.g. a text file).
    
    The problem here is we were checking for NULL titles, but not for
    zero-length titles.

 embed/ephy-embed.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index 6136b5d..0252d73 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -294,9 +294,9 @@ load_changed_cb (WebKitWebView *web_view,
   case WEBKIT_LOAD_COMMITTED:
     ephy_embed_destroy_top_widgets (embed);
     break;
-  case WEBKIT_LOAD_FINISHED:
-    if (ephy_web_view_get_is_blank (EPHY_WEB_VIEW (web_view)) ||
-        !webkit_web_view_get_title (web_view))
+  case WEBKIT_LOAD_FINISHED: {
+    const char *title = webkit_web_view_get_title (web_view);
+    if (ephy_web_view_get_is_blank (EPHY_WEB_VIEW (web_view)) || !title || !*title)
       ephy_embed_set_title (embed, NULL);
     break;
   default:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]