From 44706a1d0bc863eb6ffd9e14a207c230e9d3a028 Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Mon, 10 Aug 2009 13:38:00 +0300 Subject: Move URL normalization into a utility function --- src/ephy-link.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/ephy-link.c b/src/ephy-link.c index 7845dfb62..d6b226d65 100644 --- a/src/ephy-link.c +++ b/src/ephy-link.c @@ -89,28 +89,17 @@ ephy_link_open (EphyLink *link, EphyLinkFlags flags) { EphyEmbed *new_embed = NULL; - char *effective_url = NULL; - - /* - * WebKit does not normalize URI's by itself, so we need to - * handle this ourselves - */ - if (ephy_embed_utils_address_has_web_scheme (address) == FALSE) - { - effective_url = g_strconcat ("http://", address, NULL); - } - else - { - effective_url = g_strdup (address); - } + char *effective_address; LOG ("ephy_link_open address \"%s\" parent-embed %p flags %u", address, embed, flags); + effective_address = ephy_embed_utils_normalize_address (address); + g_signal_emit (link, signals[OPEN_LINK], 0, - effective_url, embed, flags, + effective_address, embed, flags, &new_embed); - g_free (effective_url); + g_free (effective_address); return new_embed; } -- cgit v1.2.3