[epiphany/gnome-3-16] Don't overwrite page titles in history



commit 0c8755b4bee27486578f2da5d84c509006aad904
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Sat Jul 25 15:03:54 2015 -0500

    Don't overwrite page titles in history
    
    When loading a page, we schedule two history updates: the first to reset
    the page's title to the empty string (when the web view's title property
    is unset after load started) and the second to set the page's title
    properly. The first history update is obviously a mistake. It seems like
    it should be harmless, so long as the page load is allowed to complete,
    but avoiding it seems to solve the bug where pages appear in the history
    dialog with URLs for the title, and it's clearly wrong, so let's stop
    doing this.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=741385

 embed/ephy-web-view.c              |    2 +-
 lib/history/ephy-history-service.c |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index aa3f3c9..422d2c5 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -828,7 +828,7 @@ title_changed_cb (WebKitWebView *web_view,
   if (!title && uri)
     title = title_from_address = ephy_embed_utils_get_title_from_address (uri);
 
-  if (uri && title && !ephy_web_view_is_history_frozen (webview))
+  if (uri && title && *title && !ephy_web_view_is_history_frozen (webview))
     ephy_history_service_set_url_title (history, uri, title, NULL, NULL, NULL);
 
   g_free (title_from_address);
diff --git a/lib/history/ephy-history-service.c b/lib/history/ephy-history-service.c
index 0ff2664..30b6228 100644
--- a/lib/history/ephy-history-service.c
+++ b/lib/history/ephy-history-service.c
@@ -876,6 +876,8 @@ ephy_history_service_set_url_title (EphyHistoryService *self,
 
   g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
   g_return_if_fail (orig_url != NULL);
+  g_return_if_fail (title != NULL);
+  g_return_if_fail (*title != '\0');
 
   url = ephy_history_url_new (orig_url, title, 0, 0, 0);
   message = ephy_history_service_message_new (self, SET_URL_TITLE,


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