[epiphany] Don't overwrite page titles in history
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Don't overwrite page titles in history
- Date: Tue, 8 Sep 2015 17:39:58 +0000 (UTC)
commit 257ecd12ecdb887318b2f758ca43bf1620191e0b
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 c9a61a5..9f59425 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -830,7 +830,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]