From 826724c278a218d528d254ca5631267a83c5a48f Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Mon, 24 Dec 2007 23:48:02 +0000 Subject: Display a single host entry in the History Window also when the same host is visited with different protocols (http and https). Fix bug #313481. svn path=/trunk/; revision=7818 --- embed/ephy-history.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/embed/ephy-history.c b/embed/ephy-history.c index 57f4bc0ca..f7fdcc669 100644 --- a/embed/ephy-history.c +++ b/embed/ephy-history.c @@ -699,23 +699,34 @@ internal_get_host (EphyHistory *eh, const char *url, gboolean create) { char *location; char *tmp; + + if (g_str_equal (scheme, "https")) + { + /* If scheme is https, we still fake http. */ + location = g_strconcat ("http://", host_name, "/", NULL); + host_locations = g_list_append (host_locations, location); + } + /* We append the real address */ location = g_strconcat (scheme, "://", host_name, "/", NULL); host_locations = g_list_append (host_locations, location); - if (g_str_has_prefix (host_name, "www.")) + /* and also a fake www-modified address if it's http or https. */ + if (g_str_has_prefix (scheme, "http")) { - tmp = g_strdup (g_utf8_offset_to_pointer (host_name, 4)); - } - else - { - tmp = g_strconcat ("www.", host_name, NULL); + if (g_str_has_prefix (host_name, "www.")) + { + tmp = g_strdup (host_name + 4); + } + else + { + tmp = g_strconcat ("www.", host_name, NULL); + } + location = g_strconcat ("http://", tmp, "/", NULL); + g_free (tmp); + host_locations = g_list_append (host_locations, location); } - location = g_strconcat (gnome_vfs_uri_get_scheme (vfs_uri), - "://", tmp, "/", NULL); - g_free (tmp); - host_locations = g_list_append (host_locations, location); } g_return_val_if_fail (host_locations != NULL, NULL); -- cgit v1.2.3