From af1c2ceaef7d949e36a7680f463c5e25f79c43d6 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Sun, 13 Jan 2008 20:42:01 +0000 Subject: Drop gnome-vfs dependency. Now Epiphany depends on glib >= 2.15.1. Also, optional Zeroconf support depends on Avahi >= 0.6.22. Bug #507152. svn path=/trunk/; revision=7858 --- src/bookmarks/ephy-bookmark-action.c | 59 +++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 27 deletions(-) (limited to 'src/bookmarks/ephy-bookmark-action.c') diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c index 2958f0f09..242cd00aa 100644 --- a/src/bookmarks/ephy-bookmark-action.c +++ b/src/bookmarks/ephy-bookmark-action.c @@ -32,6 +32,7 @@ #include "ephy-gui.h" #include "ephy-debug.h" #include "ephy-dnd.h" +#include "ephy-string.h" #include #include @@ -46,7 +47,6 @@ #include #include #include -#include #include @@ -367,16 +367,17 @@ ephy_bookmark_action_activate (EphyBookmarkAction *action, /* The entered search term is empty, and we have a smart bookmark */ if ((text == NULL || text[0] == '\0') && strstr (location, "%s") != NULL) { - GnomeVFSURI *uri = gnome_vfs_uri_new (location); - if (uri != NULL) - { - address = g_strconcat ( - gnome_vfs_uri_get_scheme (uri), - "://", - gnome_vfs_uri_get_host_name (uri), - NULL); - gnome_vfs_uri_unref (uri); - } + char *scheme; + char *host_name; + + scheme = g_uri_get_scheme (location); + host_name = ephy_string_get_host_name (location); + address = g_strconcat (scheme, + "://", + host_name, + NULL); + g_free (scheme); + g_free (host_name); } if (address == NULL) @@ -511,24 +512,28 @@ query_tooltip_cb (GtkWidget *proxy, { if (strstr (location, "%s") != NULL) { - GnomeVFSURI *uri = gnome_vfs_uri_new (location); - if (uri != NULL) + char *scheme; + char *host_name; + + scheme = g_uri_get_scheme (location); + host_name = ephy_string_get_host_name (location); + + if (title[0] == '\0') { - if (title[0] == '\0') - { - text = g_markup_printf_escaped ("%s://%s", - gnome_vfs_uri_get_scheme (uri), - gnome_vfs_uri_get_host_name (uri)); - } - else - { - text = g_markup_printf_escaped ("%s\n%s://%s", - title, - gnome_vfs_uri_get_scheme (uri), - gnome_vfs_uri_get_host_name (uri)); - } - gnome_vfs_uri_unref (uri); + text = g_markup_printf_escaped ("%s://%s", + scheme, + host_name); } + else + { + text = g_markup_printf_escaped ("%s\n%s://%s", + title, + scheme, + host_name); + } + + g_free (scheme); + g_free (host_name); } if (text == NULL) { -- cgit