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 --- embed/ephy-history.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'embed/ephy-history.c') diff --git a/embed/ephy-history.c b/embed/ephy-history.c index f7fdcc669..127d97656 100644 --- a/embed/ephy-history.c +++ b/embed/ephy-history.c @@ -30,11 +30,11 @@ #include "eel-gconf-extensions.h" #include "ephy-prefs.h" #include "ephy-glib-compat.h" +#include "ephy-string.h" #include #include #include -#include #define EPHY_HISTORY_XML_ROOT (const xmlChar *)"ephy_history" #define EPHY_HISTORY_XML_VERSION (const xmlChar *)"1.0" @@ -658,11 +658,10 @@ ephy_history_host_visited (EphyHistory *eh, static EphyNode * internal_get_host (EphyHistory *eh, const char *url, gboolean create) { - GnomeVFSURI *vfs_uri = NULL; EphyNode *host = NULL; - const char *host_name = NULL; + char *host_name = NULL; GList *host_locations = NULL, *l; - const char *scheme = NULL; + char *scheme = NULL; GTime now; g_return_val_if_fail (url != NULL, NULL); @@ -674,24 +673,22 @@ internal_get_host (EphyHistory *eh, const char *url, gboolean create) now = time (NULL); - vfs_uri = gnome_vfs_uri_new (url); - - if (vfs_uri) + if (url) { - scheme = gnome_vfs_uri_get_scheme (vfs_uri); - host_name = gnome_vfs_uri_get_host_name (vfs_uri); + scheme = g_uri_get_scheme (url); + host_name = ephy_string_get_host_name (url); } /* Build an host name */ if (scheme == NULL || host_name == NULL) { - host_name = _("Others"); + host_name = g_strdup (_("Others")); host_locations = g_list_append (host_locations, g_strdup ("about:blank")); } else if (strcmp (scheme, "file") == 0) { - host_name = _("Local files"); + host_name = g_strdup (_("Local files")); host_locations = g_list_append (host_locations, g_strdup ("file:///")); } @@ -766,10 +763,8 @@ internal_get_host (EphyHistory *eh, const char *url, gboolean create) ephy_history_host_visited (eh, host, now); } - if (vfs_uri) - { - gnome_vfs_uri_unref (vfs_uri); - } + g_free (scheme); + g_free (host_name); g_list_foreach (host_locations, (GFunc)g_free, NULL); g_list_free (host_locations); -- cgit v1.2.3