commit 9f81777376beed961531596ba0b252ba895b3072
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Sat Mar 22 21:32:22 2008 +0100

    Use path_exists to get rid of runtime warning.

diff --git a/src/fr-command-tar.c b/src/fr-command-tar.c
index ffa9456..35c51ef 100644
--- a/src/fr-command-tar.c
+++ b/src/fr-command-tar.c
@@ -721,11 +721,9 @@ fr_command_tar_uncompress (FrCommand *comm)
 		c_tar->uncomp_filename = NULL;
 	}
 
-	{
-		char *uri = get_uri_from_local_path (comm->filename);
-		archive_exists = path_is_file (uri);
-		g_free (uri);
-	}
+	archive_exists = (path_exists (comm->filename) 
+			&& path_is_file (comm->filename));
+
 
 	c_tar->name_modified = c_tar->compress_prog != FR_COMPRESS_PROGRAM_NONE;
 	if (c_tar->name_modified) {

commit fd1c1956118b327fa80e188a3e5322e475612f35
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Fri Mar 14 15:44:05 2008 +0100

    Use ensure_dir_exists_with_error to get rid of gnome_vfs_result_from_errno.
    
    gnome_vfs_result_to_string (gnome_vfs_result_from_errno ()) => err->message

diff --git a/src/dlg-batch-add.c b/src/dlg-batch-add.c
index a7b7e70..c60a690 100644
--- a/src/dlg-batch-add.c
+++ b/src/dlg-batch-add.c
@@ -110,6 +110,7 @@ add_clicked_cb (GtkWidget  *widget,
 	char       *tmp;
 	const char *archive_ext;
 	gboolean    do_not_add = FALSE;
+	GError     *err = NULL;
 
 	data->add_clicked = TRUE;
 
@@ -207,7 +208,8 @@ add_clicked_cb (GtkWidget  *widget,
 		do_not_add = (r != GTK_RESPONSE_YES);
 	}
 
-	if (! do_not_add && ! ensure_dir_exists (archive_dir, 0755)) {
+	if (! do_not_add && (err = ensure_dir_exists_with_error (archive_dir,
+			0755)) != NULL) {
 		GtkWidget  *d;
 
 		d = _gtk_error_dialog_new (GTK_WINDOW (window),
@@ -215,10 +217,11 @@ add_clicked_cb (GtkWidget  *widget,
 					   NULL,
 					   _("Could not create the archive"),
 					   _("Could not create the destination folder: %s."),
-					   gnome_vfs_result_to_string (gnome_vfs_result_from_errno ()));
+					   err->message);
 		gtk_dialog_run (GTK_DIALOG (d));
 		gtk_widget_destroy (GTK_WIDGET (d));
 
+		g_clear_error (&err);
 		g_free (archive_dir);
 		g_free (archive_name);
 		return;
diff --git a/src/fr-window.c b/src/fr-window.c
index 6c8c779..921db8d 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -5903,6 +5903,7 @@ fr_window_archive_extract (FrWindow   *window,
 {
 	ExtractData *edata;
 	gboolean     do_not_extract = FALSE;
+	GError      *err = NULL;
 
 	edata = extract_data_new (file_list,
 				  extract_to_dir,
@@ -5948,7 +5949,8 @@ fr_window_archive_extract (FrWindow   *window,
 				do_not_extract = TRUE;
 		}
 
-		if (! do_not_extract && ! ensure_dir_exists (edata->extract_to_dir, 0755)) {
+		if (! do_not_extract && (err = ensure_dir_exists_with_error (
+				edata->extract_to_dir, 0755)) != NULL) {
 			GtkWidget  *d;
 
 			d = _gtk_error_dialog_new (GTK_WINDOW (window),
@@ -5956,7 +5958,10 @@ fr_window_archive_extract (FrWindow   *window,
 						   NULL,
 						   _("Extraction not performed"),
 						   _("Could not create the destination folder: %s."),
-						   gnome_vfs_result_to_string (gnome_vfs_result_from_errno ()));
+						   err->message);
+
+			g_clear_error (&err);
+
 			fr_window_show_error_dialog (window, d, GTK_WINDOW (window));		
 			fr_window_stop_batch (window);
 

commit 1d9d2eddb6e75350861f1bc9c8ee9e593145ae57
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Fri Mar 14 15:41:18 2008 +0100

    Port src/file-data.c to gio content-type function.
    
    In file_data_get_mime_type_description ():
    gnome_vfs_mime_get_description () => g_content_type_get_description ()

diff --git a/src/file-data.c b/src/file-data.c
index b40bcb7..4d4fc2a 100644
--- a/src/file-data.c
+++ b/src/file-data.c
@@ -22,7 +22,7 @@
 
 #include <config.h>
 #include <glib/gi18n.h>
-#include <libgnomevfs/gnome-vfs-mime-handlers.h>
+#include <gio/gio.h>
 #include "file-data.h"
 #include "file-utils.h"
 
@@ -161,7 +161,7 @@ file_data_get_mime_type_description (const FileData *fdata)
 	if (fdata->link != NULL)
 		return DESCRIPTION_SYMLINK;
 
-	desc = gnome_vfs_mime_get_description (file_data_get_mime_type (fdata));
+	desc = g_content_type_get_description (file_data_get_mime_type (fdata));
 	if (desc == NULL)
 		desc = DESCRIPTION_UNKNOWN;
 

commit 19583776e35159eaed7771c70ef0cab682f75eff
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Fri Mar 14 15:40:11 2008 +0100

    Port src/file-utils.c get_file_mime_type() to gio.

diff --git a/src/file-utils.c b/src/file-utils.c
index 67a6c2f..fe12bde 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -742,35 +742,29 @@ const char*
 get_file_mime_type (const char *filename,
                     gboolean    fast_file_type)
 {
+	GFile      *file;
+	GFileInfo  *info;
+	GError     *err = NULL;
 	const char *result = NULL;
 	
         if (filename == NULL)
                 return NULL;
 
-        if (fast_file_type) {
-                char *sample_name;
-                char *n1;
-
-                sample_name = get_sample_name (filename);
-                if (sample_name != NULL) {
-                        n1 = g_filename_to_utf8 (sample_name, -1, 0, 0, 0);
-                        if (n1 != NULL) {
-                                char *n2 = g_utf8_strdown (n1, -1);
-                                char *n3 = g_filename_from_utf8 (n2, -1, 0, 0, 0);
-                                if (n3 != NULL)
-                                        result = gnome_vfs_mime_type_from_name_or_default (file_name_from_path (n3), NULL);
-                                g_free (n3);
-                                g_free (n2);
-                                g_free (n1);
-                        }
-                        g_free (sample_name);
-                }
-        } 
-        else {
-                if (uri_scheme_is_file (filename))
-                        filename = get_file_path_from_uri (filename);
-                result = gnome_vfs_get_file_mime_type (filename, NULL, FALSE);
-        }
+	if (uri_has_scheme (filename))
+		file = g_file_new_for_uri (filename);
+	else
+		file = g_file_new_for_path (filename);
+
+	info = g_file_query_info (file, 
+			fast_file_type ?
+				G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE :
+				G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+			0, NULL, &err);
+
+	result = g_file_info_get_content_type (info);
+
+	g_object_unref (info);
+	g_object_unref (file);
 
         return get_static_string (result);
 }

commit efd165da760e6206a067582543955e3dbca887f5
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Thu Mar 13 16:40:57 2008 +0100

    Port src/file-utils.c get_local_path_from_uri() to gio.
    
    Also does an ugly workaround for unclear definition of uri between
    gtk file chooser and gio to make all callers happy.
    (gtk_file_chooser_get_uris returns uri-escaped filenames, while
    g_file_new_for_uri seems to require a full uri - including scheme.)

diff --git a/src/file-utils.c b/src/file-utils.c
index 0ba18f3..67a6c2f 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -1341,7 +1341,36 @@ get_uri_from_local_path (const char *local_path)
 char *
 get_local_path_from_uri (const char *uri)
 {
-	return gnome_vfs_unescape_string (remove_host_from_uri (uri), NULL);
+	GFile *file;
+	char *path;
+
+	if (!uri_has_scheme(uri)) {
+		/* the caller gave us an uri-escaped local path.
+		 * (example: foo%20bar.txt). Unescape it...
+		 */
+		gboolean is_relative = (uri[0] != '/');
+		char *fixeduri = g_strconcat ("file://",
+				is_relative ? "/" : "",
+				uri, NULL);
+
+		file = g_file_new_for_uri (fixeduri);
+
+		if (is_relative) {
+			GFile *parent = g_file_new_for_path ("/");
+			path = g_file_get_relative_path (parent, file);
+			g_object_unref (parent);
+		} else {
+			path = g_file_get_path(file);
+		}
+		g_object_unref (file);
+		g_free (fixeduri);
+	} else {
+		file = g_file_new_for_uri (uri);
+		path = g_file_get_path (file);
+		g_object_unref (file);
+	}
+
+	return path;
 }
 
 
@@ -1384,28 +1413,6 @@ uri_scheme_is_file (const char *uri)
 
 }
 
-
-const char *
-remove_host_from_uri (const char *uri)
-{
-        const char *idx, *sep;
-
-        if (uri == NULL)
-                return NULL;
-
-        idx = strstr (uri, "://");
-        if (idx == NULL)
-                return uri;
-        idx += 3;
-        if (*idx == '\0')
-                return "/";
-        sep = strstr (idx, "/");
-        if (sep == NULL)
-                return idx;
-        return sep;
-}
-
-
 char *
 get_uri_host (const char *uri)
 {

commit 7819da9d22e8d3b19945f0155782206644480844
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Wed Mar 12 17:42:51 2008 +0100

    Delete unused file-util new_uri_from_path().

diff --git a/src/file-utils.c b/src/file-utils.c
index 3627d02..0ba18f3 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -1320,22 +1320,6 @@ get_home_uri (void)
 }
 
 
-GnomeVFSURI *
-new_uri_from_path (const char *path)
-{
-	char        *uri_txt;
-	GnomeVFSURI *uri;
-
-	uri_txt = get_uri_from_local_path (path);
-	uri = gnome_vfs_uri_new (uri_txt);
-	g_free (uri_txt);
-
-	g_return_val_if_fail (uri != NULL, NULL);
-
-	return uri;
-}
-
-
 char *
 get_uri_from_local_path (const char *local_path)
 {
diff --git a/src/file-utils.h b/src/file-utils.h
index ccfb3de..f06b79b 100644
--- a/src/file-utils.h
+++ b/src/file-utils.h
@@ -97,7 +97,6 @@ gboolean 	    is_program_in_path		 (const char *filename);
 /* URI/Path utils */
 
 const char *        get_home_uri                 (void);
-GnomeVFSURI *       new_uri_from_path            (const char *path);
 char *              get_uri_from_local_path      (const char *local_path);
 char *              get_local_path_from_uri      (const char *uri);
 const char *        get_file_path_from_uri       (const char *uri);

commit bc43d3fc934b927fc1fa492f0ba45aeaa7f4641a
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Wed Mar 12 17:34:25 2008 +0100

    Convert file-util check_permissions to gio.

diff --git a/src/file-utils.c b/src/file-utils.c
index d3ec007..3627d02 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -1249,29 +1249,35 @@ gboolean
 check_permissions (const char *uri,
 		   int         mode)
 {
-	GnomeVFSFileInfo *info;
-	GnomeVFSResult    vfs_result;
+	GFile            *file;
+	GFileInfo        *info;
+	GError           *err = NULL;
 	gboolean          result = TRUE;
 
-	info = gnome_vfs_file_info_new ();
-	vfs_result = gnome_vfs_get_file_info (uri,
-					      info,
-					      (GNOME_VFS_FILE_INFO_FOLLOW_LINKS
-					       | GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS));
+	file = g_file_new_for_uri (uri);
+	info = g_file_query_info (file, "access::*", 0, NULL, &err);
 
-	if (vfs_result != GNOME_VFS_OK)
+	if (err) {
+		g_warning ("Failed to get access permissions for %s: %s",
+				uri, err->message);
+		g_clear_error (&err);
 		result = FALSE;
+	}
 
-	else if ((mode & R_OK) && ! (info->permissions & GNOME_VFS_PERM_ACCESS_READABLE))
+	else if ((mode & R_OK) && ! g_file_info_get_attribute_boolean(info,
+			G_FILE_ATTRIBUTE_ACCESS_CAN_READ)) 
 		result = FALSE;
 
-	else if ((mode & W_OK) && ! (info->permissions & GNOME_VFS_PERM_ACCESS_WRITABLE))
+	else if ((mode & W_OK) && ! g_file_info_get_attribute_boolean(info,
+			G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE))
 		result = FALSE;
 
-	else if ((mode & X_OK) && ! (info->permissions & GNOME_VFS_PERM_ACCESS_EXECUTABLE))
+	else if ((mode & X_OK) && ! g_file_info_get_attribute_boolean(info,
+			G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE))
 		result = FALSE;
 
-	gnome_vfs_file_info_unref (info);
+	g_object_unref (info);
+	g_object_unref (file);
 
 	return TRUE;
 }

commit d1070338a2195dc8f4ec685466da2e376a31610e
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Wed Mar 12 17:21:55 2008 +0100

    Port file-utils remove_directory to gio.

diff --git a/src/file-utils.c b/src/file-utils.c
index 61023b6..d3ec007 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -898,19 +898,23 @@ remove_directory (const char *uri)
 	GList          *files, *dirs;
 	GList          *scan;
 	gboolean        error = FALSE;
-	GnomeVFSResult  result;
+	GFile *file;
+	GError *err = NULL;
 
 	if (! get_directory_content (uri, &files, &dirs))
 		return FALSE;
 
 	for (scan = files; scan; scan = scan->next) {
-		char *file = scan->data;
+		file = g_file_new_for_path (scan->data);
 		
-		result = gnome_vfs_unlink (file);
-		if (result != GNOME_VFS_OK) {
-			g_warning ("Cannot delete %s: %s\n", file, gnome_vfs_result_to_string (result));
+		g_file_delete (file, NULL, &err);
+		if (err) {
+			g_warning ("Cannot delete %s: %s", scan->data,
+					err->message);
+			g_clear_error (&err);
 			error = TRUE;
 		}
+		g_object_unref (file);
 	}
 
 	for (scan = dirs; scan; scan = scan->next) 
@@ -920,11 +924,14 @@ remove_directory (const char *uri)
 	path_list_free (files);
 	path_list_free (dirs);
 
-	result = gnome_vfs_remove_directory (uri);
-	if (result != GNOME_VFS_OK) {
-		g_warning ("Cannot delete %s: %s\n", uri, gnome_vfs_result_to_string (result));
+	file = g_file_new_for_uri (uri);
+	g_file_delete (file, NULL, &err);
+	if (err) {
+		g_warning ("Cannot delete %s: %s", uri, err->message);
 		error = TRUE;
+		g_clear_error (&err);
 	}
+	g_object_unref (file);
 
 	return ! error;
 }

commit 8f8055ee1b3c2741e313e847b89854697ccd72d5
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Wed Mar 12 17:16:00 2008 +0100

    Port file-utils get_directory_content to GIO.
    
    Fix typo in src/file-utils.c get_directory_content().
    
    Move definition of SPECIAL_DIR in src/file-utils.c to the top.
    
    Some functions tried to use it before it was defined, making the linking fail
    since there was no such function available.
    
    Add break at the end of switch statement to please gcc.
    
    The default case is to do nothing, but apparently just putting the default
    label last isn't good enough. Add a useless break to make everyone happy.

diff --git a/src/file-utils.c b/src/file-utils.c
index 4a681a1..61023b6 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -52,6 +52,8 @@
 #define FILE_PREFIX    "file://"
 #define FILE_PREFIX_L  7
 
+#define SPECIAL_DIR(x) (! strcmp (x, "..") || ! strcmp (x, "."))
+
 
 static gboolean
 pathoruri_exists (const char *uri, gboolean is_path)
@@ -213,7 +215,7 @@ dir_contains_one_object (const char *uri)
 
 		name = g_file_info_get_name (info);
 
-		if (strcmp (name, ".") == 0 || strcmp (name, "..") == 0) {
+		if (SPECIAL_DIR (name)) {
 			g_object_unref (info);
 			continue;
 		}
@@ -264,7 +266,7 @@ get_directory_content_if_unique (const char  *uri)
 			continue;
 		}
 
-		if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0) {
+		if (SPECIAL_DIR (name)) {
 			g_object_unref (info);
 			continue;
 		}
@@ -826,55 +828,60 @@ get_dest_free_space (const char *uri)
 }
 
 
-#define SPECIAL_DIR(x) (! strcmp (x, "..") || ! strcmp (x, "."))
-
 
 static gboolean
 get_directory_content (const char  *uri,
 	       	       GList      **files,
 	               GList      **dirs)
 {
-	GnomeVFSDirectoryHandle *h;
-	GnomeVFSResult           result;
-	GnomeVFSFileInfo        *info;
-	GList                   *f_list = NULL;
-	GList                   *d_list = NULL;
+	GList           *f_list = NULL;
+	GList           *d_list = NULL;
+	GFile           *file;
+	GFileEnumerator *fileenum;
+	GFileInfo       *info;
+	GError          *err = NULL;
 		
 	if (dirs) 
 		*dirs = NULL;
 	if (files) 
 		*files = NULL;
 
-	result = gnome_vfs_directory_open (&h, uri, GNOME_VFS_FILE_INFO_DEFAULT);
-	if (result != GNOME_VFS_OK)
-		return FALSE;	
-
-	info = gnome_vfs_file_info_new ();
+	file = g_file_new_for_uri (uri);
+	fileenum = g_file_enumerate_children (file, 
+			G_FILE_ATTRIBUTE_STANDARD_NAME ","
+			G_FILE_ATTRIBUTE_STANDARD_TYPE,
+			0, NULL, &err);
 	
-	while ((result = gnome_vfs_directory_read_next (h, info)) == GNOME_VFS_OK) {
+	while ((info = g_file_enumerator_next_file (fileenum, NULL, &err))
+			!= NULL) {
+		const char *name;
 		char *entry_uri;
-		char *e_name;
 		
-		e_name = gnome_vfs_escape_string (info->name);
-		entry_uri = g_strconcat (uri, "/", e_name, NULL);
-		g_free (e_name);
-		
-		if (info->type == GNOME_VFS_FILE_TYPE_DIRECTORY) {
-			if (! SPECIAL_DIR (info->name)) {
+		name = g_file_info_get_name (info);
+		entry_uri = g_build_path ("/", uri, name, NULL);
+	
+		switch (g_file_info_get_file_type (info)) {
+		case G_FILE_TYPE_DIRECTORY:
+			if (! SPECIAL_DIR (name)) {
 				d_list = g_list_prepend (d_list, entry_uri);
 				entry_uri = NULL;
 			}
-		}
-		else if (info->type == GNOME_VFS_FILE_TYPE_REGULAR) {
+		break;
+		case G_FILE_TYPE_REGULAR:
 			f_list = g_list_prepend (f_list, entry_uri);
 			entry_uri = NULL;
+		break;
+		default:
+		/* do nothing */
+		break;
 		}
 		
 		g_free (entry_uri);	
+		g_object_unref (info);
 	}
 	
-	gnome_vfs_file_info_unref (info);
-	gnome_vfs_directory_close (h);
+	g_object_unref (fileenum);
+	g_object_unref (file);
 	
 	if (dirs) 
 		*dirs = g_list_reverse (d_list);

commit cc81811e310a3a95a188bed9349f73ba998a40c4
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Wed Mar 12 16:45:06 2008 +0100

    Port ensure_dir_exists and src/dlg-extract.c to gio.
    
    the extract dialog used gnome-vfs and errno to display error,
    so a new ensure_dir_exists_with_error was added that returns the
    GError which contains the error message to be used.
    
    The helper ensure_dir_exists was ported over to use the _with_error
    to keep API-compatability.

diff --git a/src/dlg-extract.c b/src/dlg-extract.c
index 1f89618..247b989 100644
--- a/src/dlg-extract.c
+++ b/src/dlg-extract.c
@@ -24,6 +24,7 @@
 #include <string.h>
 #include <unistd.h>
 
+#include <glib.h> /* GError */
 #include <glade/glade.h>
 
 #include "bookmarks.h"
@@ -93,6 +94,7 @@ extract_cb (GtkWidget   *w,
 	GList      *file_list;
 	char       *password;
 	char       *base_dir = NULL;
+	GError     *err = NULL;
 
 	data->extract_clicked = TRUE;
 
@@ -132,11 +134,12 @@ extract_cb (GtkWidget   *w,
 				do_not_extract = TRUE;
 		}
 
-		if (! do_not_extract && ! ensure_dir_exists (extract_to_dir, 0755)) {
+		if (!do_not_extract && (err = ensure_dir_exists_with_error (
+				extract_to_dir, 0755)) != NULL) {
 			GtkWidget  *d;
 			char       *message;
 
-			message = g_strdup_printf (_("Could not create the destination folder: %s."), gnome_vfs_result_to_string (gnome_vfs_result_from_errno ()));
+			message = g_strdup_printf (_("Could not create the destination folder: %s."), err->message);
 
 			d = _gtk_error_dialog_new (GTK_WINDOW (window),
 						   GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -146,6 +149,7 @@ extract_cb (GtkWidget   *w,
 			gtk_dialog_run (GTK_DIALOG (d));
 			gtk_widget_destroy (GTK_WIDGET (d));
 
+			g_clear_error (&err);
 			g_free (message);
 
 			return FALSE;
diff --git a/src/file-utils.c b/src/file-utils.c
index 2ab0c88..4a681a1 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -585,38 +585,67 @@ remove_ending_separator (const gchar *path)
 	return g_strndup (path, copy_len);
 }
 
+GError *
+ensure_dir_exists_with_error (const gchar *a_path,
+		mode_t mode)
+{
+	GFile *file, *parent;
+	GError *err = NULL;
+
+	if (! a_path)
+		return NULL;
+	if (path_is_dir (a_path))
+		return NULL;
+
+	file = g_file_new_for_path (a_path);
+	parent = g_file_get_parent (file);
+
+	if (parent != NULL) {
+		char *parent_path;
+		
+		parent_path = g_file_get_path (parent);
+		err = ensure_dir_exists_with_error (parent_path, mode);
+
+		g_free (parent_path);
+		g_object_unref (parent);
+
+		if (err) {
+			g_object_unref (file);
+			return err;
+		}
+	}
+
+	g_file_make_directory (file, NULL, &err);
+
+	if (err) {
+		g_object_unref (file);
+		return err;
+	}
+
+	g_file_set_attribute_uint32 (file,
+			G_FILE_ATTRIBUTE_UNIX_MODE,
+			mode, 0, NULL, &err);
+
+	g_object_unref (file);
+
+	return err;
+}
 
 gboolean
 ensure_dir_exists (const gchar *a_path,
 		   mode_t       mode)
 {
+	GError *err = NULL;
+
 	if (! a_path) return FALSE;
 
-	if (! path_is_dir (a_path)) {
-		char *path = g_strdup (a_path);
-		char *p = path;
 
-		while (*p != '\0') {
-			p++;
-			if ((*p == '/') || (*p == '\0')) {
-				gboolean end = TRUE;
-
-				if (*p != '\0') {
-					*p = '\0';
-					end = FALSE;
-				}
-
-				if (! path_is_dir (path)) {
-					if (gnome_vfs_make_directory (path, mode) != GNOME_VFS_OK) {
-						g_warning ("directory creation failed: %s.", path);
-						g_free (path);
-						return FALSE;
-					}
-				}
-				if (! end) *p = '/';
-			}
-		}
-		g_free (path);
+	err = ensure_dir_exists_with_error (a_path, mode);
+
+	if (err) {
+		g_warning ("directory creation failed: %s", err->message);
+		g_clear_error (&err);
+		return FALSE;
 	}
 
 	return TRUE;

commit 50a442dda764cc458db9813487ac4e712e11ea22
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Wed Mar 12 16:09:01 2008 +0100

    Port src/actions.c to gio.
    
    Fix compilation of src/actions.c in activate_action_save_as().

diff --git a/src/actions.c b/src/actions.c
index 6637449..ce2d291 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -25,8 +25,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
+#include <gio/gio.h>
 #include "actions.h"
 #include "dlg-add-files.h"
 #include "dlg-add-folder.h"
@@ -323,25 +322,34 @@ filetype_combobox_changed_cb (GtkComboBox *combo_box,
 	int         idx;
 	const char *filename;
 	const char *ext, *newext;
-	char       *escaped_uri;
-	char       *unescaped_uri;	
 	char       *new_filename, *filename_noext;
+	const char *uri;
+	GFile      *file;
+	GFileInfo  *info;
+	GError     *err = NULL;
 
 	idx = gtk_combo_box_get_active (combo_box) - 1;
 	if (idx < 0)
 		return;
 
-	escaped_uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (file_sel));
-	if (escaped_uri == NULL)
+	uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (file_sel));
+	if (uri == NULL)
 		return;
 
-	unescaped_uri = gnome_vfs_format_uri_for_display (escaped_uri);
-	filename = file_name_from_path (unescaped_uri);
-	if (filename == NULL) {
-		g_free (unescaped_uri);
+	file = g_file_new_for_uri (uri);
+	info = g_file_query_info (file, 
+			G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME,
+			0, NULL, &err);
+	if (err) {
+		g_warning ("Failed to get display name for uri %s: %s",
+				uri, err->message);
+		g_clear_error (&err);
+		g_object_unref (file);
 		return;
 	}
 
+	filename = g_file_info_get_display_name (info);
+
 	ext = fr_archive_utils__get_file_name_ext (filename);
 	if (ext == NULL)
 		ext = "";
@@ -350,11 +358,11 @@ filetype_combobox_changed_cb (GtkComboBox *combo_box,
 
 	newext = file_type_desc[save_type[idx]].ext;
 	new_filename = g_strconcat (filename_noext, newext, NULL);
-	gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (file_sel), new_filename);
+	gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (file_sel),
+			new_filename);
 
 	g_free (new_filename);
 	g_free (filename_noext);
-	g_free (unescaped_uri);
 }
 
 
@@ -592,8 +600,6 @@ activate_action_save_as (GtkAction *action,
 	GtkWidget     *combo_box;
 	GtkFileFilter *filter;
 	int            i;
-	const char    *escaped_uri = NULL;
-	char          *unescaped_uri = NULL;
 
 	file_sel = gtk_file_chooser_dialog_new (_("Save"),
 						GTK_WINDOW (window),
@@ -607,10 +613,28 @@ activate_action_save_as (GtkAction *action,
 	gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (file_sel), fr_window_get_open_default_dir (window));
 
 	if (fr_window_get_archive_uri (window)) {
-		escaped_uri = fr_window_get_archive_uri (window);
-		unescaped_uri = gnome_vfs_format_uri_for_display (escaped_uri);
-		gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (file_sel), file_name_from_path (unescaped_uri));
-		g_free (unescaped_uri);
+		const char *uri;
+		GFile     *file;
+		GFileInfo *info;
+		GError    *err = NULL;
+
+		uri = fr_window_get_archive_uri (window);
+		file = g_file_new_for_uri (uri);
+		info = g_file_query_info (file,
+				G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME,
+				0, NULL, &err);
+
+		if (err) {
+			g_warning ("Failed to get display name for uri %s: %s",
+				uri, err->message);
+			g_clear_error (&err);
+		} else {
+			gtk_file_chooser_set_current_name (
+					GTK_FILE_CHOOSER (file_sel),
+					g_file_info_get_display_name (info));
+		}
+		g_object_unref (info);
+		g_object_unref (file);
 	}
 
 	filter = gtk_file_filter_new ();

commit 168e5820f2c01119af9299a34f14caf3fb6af9f9
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Wed Mar 12 14:09:16 2008 +0100

    Fix compilation by using TRUE/FALSE in {uri,path}_exists.

diff --git a/src/file-utils.c b/src/file-utils.c
index d2901ef..2ab0c88 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -88,13 +88,13 @@ pathoruri_exists (const char *uri, gboolean is_path)
 gboolean
 uri_exists (const char *uri)
 {
-	pathoruri_exists (uri, false);
+	pathoruri_exists (uri, FALSE);
 }
 
 gboolean
 path_exists (const char *path)
 {
-	pathoruri_exists (path, true);
+	pathoruri_exists (path, TRUE);
 }
 
 static gboolean

commit 759608534121ab853cdc4c09426fa9110f81b02c
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Wed Mar 12 13:25:44 2008 +0100

    Add path_exists helper.
    
    Refactor uri_exists helper to reuse code in both helpers.

diff --git a/src/file-utils.c b/src/file-utils.c
index 1d4ddf6..d2901ef 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -53,8 +53,8 @@
 #define FILE_PREFIX_L  7
 
 
-gboolean
-uri_exists (const char  *uri)
+static gboolean
+pathoruri_exists (const char *uri, gboolean is_path)
 {
 	GFile     *file;
 	GFileInfo *info;
@@ -64,7 +64,11 @@ uri_exists (const char  *uri)
 	if (uri == NULL) 
 		return FALSE;
 
-	file = g_file_new_for_uri (uri);
+	if (is_path)
+		file = g_file_new_for_path (uri);
+	else
+		file = g_file_new_for_uri (uri);
+
 	info = g_file_query_info (file,
 			G_FILE_ATTRIBUTE_STANDARD_NAME, 0, NULL, &err);
 
@@ -81,6 +85,18 @@ uri_exists (const char  *uri)
 	return exists;	
 }
 
+gboolean
+uri_exists (const char *uri)
+{
+	pathoruri_exists (uri, false);
+}
+
+gboolean
+path_exists (const char *path)
+{
+	pathoruri_exists (path, true);
+}
+
 static gboolean
 path_is_filetype (const char *path, GFileType ft)
 {

commit 53b41f5a9764e6096d383862ee1158496c503139
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Wed Mar 12 13:21:56 2008 +0100

    Add fixme and use uri_has_scheme in path_is_... helper.

diff --git a/src/file-utils.c b/src/file-utils.c
index c71c713..1d4ddf6 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -92,7 +92,11 @@ path_is_filetype (const char *path, GFileType ft)
 	if (! path || ! *path)
 		return FALSE;
 
-	if (*path == '/')
+	/* FIXME: some callers use local paths others use uris.
+	 * Ugly check for absolute path to se which one to use.
+	 * Callers should really be fixed.
+	 */
+	if (!uri_has_scheme(path))
 		file = g_file_new_for_path (path);
 	else
 		file = g_file_new_for_uri (path);

commit 1b74e1535b6f66cdbbdfb706e29b88aaa6a70b73
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Wed Mar 12 10:59:33 2008 +0100

    And make it compile...

diff --git a/src/actions.c b/src/actions.c
index c9c9a26..6637449 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -167,7 +167,7 @@ get_archive_filename_from_selector (FrWindow  *window,
 		g_object_unref (info);
 		g_object_unref (dir);
 		g_object_unref (file);
-		g_free (path);
+		g_free (uri);
 		return NULL;
 	}
 
@@ -196,7 +196,7 @@ get_archive_filename_from_selector (FrWindow  *window,
 
 	/* if the user did not specify a valid extension use the filetype combobox current type
 	 * or tar.gz if automatic is selected. */
-	if (fr_archive_utils__get_file_name_ext (path) == NULL) {
+	if (fr_archive_utils__get_file_name_ext (uri) == NULL) {
 		GtkWidget *combo_box;
 		int        idx;
 		char      *new_uri;
@@ -227,7 +227,7 @@ get_archive_filename_from_selector (FrWindow  *window,
 
 		g_object_unref (info);
 
-		if (! is_supported_extension (file_sel, path)) {
+		if (! is_supported_extension (file_sel, uri)) {
 			dialog = _gtk_error_dialog_new (GTK_WINDOW (file_sel),
 							GTK_DIALOG_MODAL,
 							NULL,

commit 0bdc9ed56e96169043bd8b944b529ae43c9f0789
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Wed Mar 12 10:58:02 2008 +0100

    Argh, get_full_path actually returns an uri - not a path!
    
    rename path pointer to uri and switch to g_file_new_for_uri.

diff --git a/src/actions.c b/src/actions.c
index b1af51b..c9c9a26 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -129,16 +129,16 @@ static char *
 get_archive_filename_from_selector (FrWindow  *window,
 				    GtkWidget *file_sel)
 {
-	char *path = NULL;
+	char *uri = NULL;
 	GFile *file, *dir;
 	GFileInfo *info;
 	GError *err = NULL;
 
-	path = get_full_path (file_sel);
-	if ((path == NULL) || (*path == 0)) {
+	uri = get_full_path (file_sel);
+	if ((uri == NULL) || (*uri == 0)) {
 		GtkWidget *dialog;
 
-		g_free (path);
+		g_free (uri);
 
 		dialog = _gtk_error_dialog_new (GTK_WINDOW (file_sel),
 						GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -151,7 +151,7 @@ get_archive_filename_from_selector (FrWindow  *window,
 		return NULL;
 	}
 
-	file = g_file_new_for_path (path);
+	file = g_file_new_for_uri (uri);
 	dir = g_file_get_parent (file);
 
 	info = g_file_query_info (dir,
@@ -177,7 +177,7 @@ get_archive_filename_from_selector (FrWindow  *window,
 
 		GtkWidget *dialog;
 
-		g_free (path);
+		g_free (uri);
 		g_object_unref (info);
 		g_object_unref (dir);
 		g_object_unref (file);
@@ -199,7 +199,7 @@ get_archive_filename_from_selector (FrWindow  *window,
 	if (fr_archive_utils__get_file_name_ext (path) == NULL) {
 		GtkWidget *combo_box;
 		int        idx;
-		char      *new_path;
+		char      *new_uri;
 		char      *ext = NULL;
 
 		combo_box = g_object_get_data (G_OBJECT (file_sel), "fr_combo_box");
@@ -208,12 +208,12 @@ get_archive_filename_from_selector (FrWindow  *window,
 			ext = file_type_desc[save_type[idx-1]].ext;
 		else
 			ext = ".tar.gz";
-		new_path = g_strconcat (path, ext, NULL);
-		g_free (path);
-		path = new_path;
+		new_uri = g_strconcat (uri, ext, NULL);
+		g_free (uri);
+		uri = new_uri;
 	}
 
-	debug (DEBUG_INFO, "create/save %s\n", path);
+	debug (DEBUG_INFO, "create/save %s\n", uri);
 
 	info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_TYPE,
 			0, NULL, &err);
@@ -235,7 +235,7 @@ get_archive_filename_from_selector (FrWindow  *window,
 							_("Archive type not supported."));
 			gtk_dialog_run (GTK_DIALOG (dialog));
 			gtk_widget_destroy (GTK_WIDGET (dialog));
-			g_free (path);
+			g_free (uri);
 			g_object_unref (file);
 
 			return NULL;
@@ -255,7 +255,7 @@ get_archive_filename_from_selector (FrWindow  *window,
 		gtk_widget_destroy (GTK_WIDGET (dialog));
 
 		if (r != GTK_RESPONSE_YES) {
-			g_free (path);
+			g_free (uri);
 			g_object_unref (file);
 			return NULL;
 		}
@@ -271,7 +271,7 @@ get_archive_filename_from_selector (FrWindow  *window,
 							err->message);
 			gtk_dialog_run (GTK_DIALOG (dialog));
 			gtk_widget_destroy (GTK_WIDGET (dialog));
-			g_free (path);
+			g_free (uri);
 			g_error_free (err);
 			g_object_unref (file);
 			return NULL;
@@ -280,7 +280,7 @@ get_archive_filename_from_selector (FrWindow  *window,
 
 	g_object_unref (file);
 
-	return path;
+	return uri;
 }
 
 

commit afbeda7eefe7d6d3edf491cc0117da8c40c8e780
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Tue Mar 11 18:23:28 2008 +0100

    GIO-fy get_archive_filename_from_selector to get rid of runtime warning.
    
    when creating new archive it's not a problem if the file doesn't exists,
    which is checked to see if we need to ask if it should be overwritten.

diff --git a/src/actions.c b/src/actions.c
index be48d9a..b1af51b 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -130,7 +130,9 @@ get_archive_filename_from_selector (FrWindow  *window,
 				    GtkWidget *file_sel)
 {
 	char *path = NULL;
-	char *dir;
+	GFile *file, *dir;
+	GFileInfo *info;
+	GError *err = NULL;
 
 	path = get_full_path (file_sel);
 	if ((path == NULL) || (*path == 0)) {
@@ -149,12 +151,36 @@ get_archive_filename_from_selector (FrWindow  *window,
 		return NULL;
 	}
 
-	dir = remove_level_from_path (path);
-	if (! check_permissions (dir, R_OK | W_OK | X_OK)) {
+	file = g_file_new_for_path (path);
+	dir = g_file_get_parent (file);
+
+	info = g_file_query_info (dir,
+		G_FILE_ATTRIBUTE_ACCESS_CAN_READ ","
+		G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE ","
+		G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE,
+		0, NULL, &err);
+
+	if (err) {
+		g_warning ("Failed to get permission for extraction dir: %s",
+				err->message);
+		g_clear_error (&err);
+		g_object_unref (info);
+		g_object_unref (dir);
+		g_object_unref (file);
+		g_free (path);
+		return NULL;
+	}
+
+	//if (! check_permissions (dir, R_OK | W_OK | X_OK)) {
+	if (! g_file_info_get_attribute_boolean (info,
+			G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE)) {
+
 		GtkWidget *dialog;
 
-		g_free (dir);
 		g_free (path);
+		g_object_unref (info);
+		g_object_unref (dir);
+		g_object_unref (file);
 
 		dialog = _gtk_error_dialog_new (GTK_WINDOW (file_sel),
 						GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -165,7 +191,8 @@ get_archive_filename_from_selector (FrWindow  *window,
 		gtk_widget_destroy (GTK_WIDGET (dialog));
 		return NULL;
 	}
-	g_free (dir);
+	g_object_unref (info);
+	g_object_unref (dir);
 
 	/* if the user did not specify a valid extension use the filetype combobox current type
 	 * or tar.gz if automatic is selected. */
@@ -188,11 +215,17 @@ get_archive_filename_from_selector (FrWindow  *window,
 
 	debug (DEBUG_INFO, "create/save %s\n", path);
 
-	if (path_is_file (path)) {
+	info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_TYPE,
+			0, NULL, &err);
+
+	// ignore errors - missing file is ok.
+	g_clear_error (&err);
+
+	if (info && (g_file_info_get_file_type(info) == G_FILE_TYPE_REGULAR)) {
 		GtkWidget      *dialog;
 		int             r;
-		GFile          *file;
-		GError         *err = NULL;
+
+		g_object_unref (info);
 
 		if (! is_supported_extension (file_sel, path)) {
 			dialog = _gtk_error_dialog_new (GTK_WINDOW (file_sel),
@@ -203,6 +236,7 @@ get_archive_filename_from_selector (FrWindow  *window,
 			gtk_dialog_run (GTK_DIALOG (dialog));
 			gtk_widget_destroy (GTK_WIDGET (dialog));
 			g_free (path);
+			g_object_unref (file);
 
 			return NULL;
 		}
@@ -222,10 +256,10 @@ get_archive_filename_from_selector (FrWindow  *window,
 
 		if (r != GTK_RESPONSE_YES) {
 			g_free (path);
+			g_object_unref (file);
 			return NULL;
 		}
 
-		file = g_file_new_for_path (path);
 		g_file_delete (file, NULL, &err);
 		g_object_unref (file);
 		if (err) {
@@ -239,10 +273,13 @@ get_archive_filename_from_selector (FrWindow  *window,
 			gtk_widget_destroy (GTK_WIDGET (dialog));
 			g_free (path);
 			g_error_free (err);
+			g_object_unref (file);
 			return NULL;
 		}
 	}
 
+	g_object_unref (file);
+
 	return path;
 }
 

commit 6a644bf2a3ee6380bafc6a7c10ab8b0325783629
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Tue Mar 11 17:47:08 2008 +0100

    Add unrar as recognized filetype.
    
    This will hopefully get .rar added to the file open dialog filter
    for "All archives", to make .rar visible when you only have unrar.

diff --git a/src/main.c b/src/main.c
index 0b93247..8654962 100644
--- a/src/main.c
+++ b/src/main.c
@@ -105,6 +105,7 @@ FRCommandDescription command_desc[] = {
 	{ "zip",        TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_ZIP },
 	{ "unzip",      TRUE,  FALSE, TRUE,  FR_FILE_TYPE_ZIP },
 	{ "rar",        TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_RAR },
+	{ "unrar",      TRUE,  FALSE, TRUE,  FR_FILE_TYPE_RAR },
 	{ "gzip",       TRUE,  TRUE,  FALSE, FR_FILE_TYPE_GZIP },
 	{ "bzip2",      TRUE,  TRUE,  FALSE, FR_FILE_TYPE_BZIP2 },
 	{ "unace",      TRUE,  FALSE, TRUE,  FR_FILE_TYPE_ACE },

commit b3449161d91457523bf3b190d4f58cfcde4f0546
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Tue Mar 11 16:22:08 2008 +0100

    Convert file and parent folder deletion in fr-archive to gio.

diff --git a/src/fr-archive.c b/src/fr-archive.c
index b845fdd..a703b6c 100644
--- a/src/fr-archive.c
+++ b/src/fr-archive.c
@@ -29,6 +29,7 @@
 
 #include <glib.h>
 #include <glib/gi18n.h>
+#include <gio/gio.h>
 #include <libgnomevfs/gnome-vfs-mime.h>
 #include <libgnomevfs/gnome-vfs-ops.h>
 #include <libgnomevfs/gnome-vfs-utils.h>
@@ -418,17 +419,31 @@ fr_archive_set_uri (FrArchive  *archive,
 		    const char *uri)
 {
 	if ((archive->local_filename != NULL) && archive->is_remote) {
-		char *file_uri;
-		char *folder_uri;
+		GFile *file, *folder;
+		GError *err = NULL;
 
-		file_uri = get_uri_from_local_path (archive->local_filename);
-		gnome_vfs_unlink (file_uri);
+		file = g_file_new_for_path (archive->local_filename);
+		g_file_delete (file, NULL, &err);
 
-		folder_uri = remove_level_from_path (file_uri);
-		gnome_vfs_remove_directory (folder_uri);
+		if (err) {
+			g_warning ("Failed to delete file %s: %s",
+					archive->local_filename,
+					err->message);
+			g_clear_error (&err);
+		}
+
+		folder = g_file_get_parent (file);
+		g_file_delete (folder, NULL, &err);
+
+		if (err) {
+			g_warning ("Failed to delete parent folder of %s: %s",
+					archive->local_filename,
+					err->message);
+			g_clear_error (&err);
+		}
 
-		g_free (file_uri);
-		g_free (folder_uri);
+		g_object_unref (folder);
+		g_object_unref (file);
 	}
 
 	if (uri != archive->uri) {

commit 6ea7496d32546256308a707f2357e8cb20d012eb
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Tue Mar 11 16:21:39 2008 +0100

    Convert get_directory_content_if_unique to gio.

diff --git a/src/file-utils.c b/src/file-utils.c
index 9593a4b..c71c713 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -214,31 +214,59 @@ dir_contains_one_object (const char *uri)
 char *
 get_directory_content_if_unique (const char  *uri)
 {
-	GnomeVFSDirectoryHandle *handle;
-	GnomeVFSResult           result;
-	GnomeVFSFileInfo        *info;
+	GFile                   *file;
+	GFileEnumerator         *fileenum;
+	GFileInfo               *info;
+	GError                  *err = NULL;
 	char                    *content_uri = NULL;
-	
-	result = gnome_vfs_directory_open (&handle, uri,
-			GNOME_VFS_FILE_INFO_DEFAULT);
-	if (result != GNOME_VFS_OK)
+
+	file = g_file_new_for_uri (uri);
+	fileenum = g_file_enumerate_children (file,
+			G_FILE_ATTRIBUTE_STANDARD_NAME,
+			0, NULL, &err);
+
+	if (err) {
+		g_warning ("Failed to enumerate children of %s: %s",
+				uri, err->message);
+		g_error_free (err);
 		return NULL;
-	
-	info = gnome_vfs_file_info_new ();
-	while (gnome_vfs_directory_read_next (handle, info) == GNOME_VFS_OK) {
-		if ((strcmp (info->name, ".") == 0)
-				|| (strcmp (info->name, "..") == 0))
+	}
+
+	while ((info = g_file_enumerator_next_file (fileenum, NULL, &err))
+			!= NULL) {
+		const char *name = g_file_info_get_name (info);
+
+		if (err) {
+			g_warning ("Failed to get info while enumerating children: %s",
+					err->message);
+			g_clear_error (&err);
+			g_object_unref (info);
 			continue;
+		}
+
+		if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0) {
+			g_object_unref (info);
+			continue;
+		}
 		if (content_uri != NULL) {
 			g_free (content_uri);
+			g_object_unref (info);
 			content_uri = NULL;
 			break;
 		}
-		else
-			content_uri = g_strconcat (uri, "/", info->name, NULL);
+		
+		content_uri = g_build_path (uri, name, NULL);
+		g_object_unref (info);
 	}
-	gnome_vfs_file_info_unref (info);
-	gnome_vfs_directory_close (handle);
+
+	if (err) {
+		g_warning ("Failed to get info after enumerating children: %s",
+				err->message);
+		g_clear_error (&err);
+	}
+
+	g_object_unref (fileenum);
+	g_object_unref (file);
 	
 	return content_uri;	
 }

commit 763f585f8af52de32028f8d8db57181b238872ff
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Tue Mar 11 16:21:10 2008 +0100

    Convert file deletion in batch-add to gio.

diff --git a/src/dlg-batch-add.c b/src/dlg-batch-add.c
index fa8da45..a7b7e70 100644
--- a/src/dlg-batch-add.c
+++ b/src/dlg-batch-add.c
@@ -288,9 +288,19 @@ add_clicked_cb (GtkWidget  *widget,
 		r = gtk_dialog_run (GTK_DIALOG (d));
 		gtk_widget_destroy (GTK_WIDGET (d));
 
-		if (r == GTK_RESPONSE_YES)
-			gnome_vfs_unlink (archive_file);
-		else {
+		if (r == GTK_RESPONSE_YES) {
+			GFile  *file;
+			GError *err = NULL;
+
+			file = g_file_new_for_path (archive_file);
+			g_file_delete (file, NULL, &err);
+			if (err) {
+				g_warning ("Failed to delete file %s: %s",
+						archive_file, err->message);
+				g_clear_error (&err);
+			}
+			g_object_unref (file);
+		} else {
 			g_free (archive_name);
 			g_free (archive_dir);
 			g_free (archive_file);

commit f0a5bdec7e478fec56c503e87d57f7441c031759
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Tue Mar 11 16:20:23 2008 +0100

    Convert population of liststore and file removal in add-folder to gio.

diff --git a/src/dlg-add-folder.c b/src/dlg-add-folder.c
index dd0c684..24c9f07 100644
--- a/src/dlg-add-folder.c
+++ b/src/dlg-add-folder.c
@@ -28,6 +28,7 @@
 #include <gtk/gtk.h>
 #include <libgnome/gnome-config.h>
 #include <glade/glade.h>
+#include <gio/gio.h>
 #include <libgnomevfs/gnome-vfs-mime.h>
 #include <libgnomevfs/gnome-vfs-mime-handlers.h>
 #include <libgnomevfs/gnome-vfs-directory.h>
@@ -525,46 +526,69 @@ static void
 aod_update_option_list (LoadOptionsDialogData *aod_data)
 {
 	GtkListStore   *list_store = GTK_LIST_STORE (aod_data->aod_model);
-	char           *options_dir;
-	GnomeVFSResult  result;
-	GList          *list = NULL;
+	char            *options_dir;
+	GFile           *file;
+	GFileEnumerator *fileenum;
+	GFileInfo       *info;
+	GError          *err = NULL;
 
 	gtk_list_store_clear (list_store);
 
 	options_dir = get_home_relative_dir (RC_OPTIONS_DIR);
 	ensure_dir_exists (options_dir, 0700);
 
-	result = gnome_vfs_directory_list_load (&list,
-						options_dir,
-						GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
-
-	if (result == GNOME_VFS_OK) {
-		GList *scan;
-
-		for (scan = list; scan; scan = scan->next) {
-			GnomeVFSFileInfo *file_info = scan->data;
-			GtkTreeIter       iter;
-			char             *full_path;
-
-			if ((strcmp (file_info->name, ".") == 0)
-			    || (strcmp (file_info->name, "..") == 0))
-				continue;
-
-			full_path = g_build_filename (options_dir,
-						      file_info->name,
-						      NULL);
-			gtk_list_store_append (GTK_LIST_STORE (aod_data->aod_model),
-					       &iter);
-			gtk_list_store_set (GTK_LIST_STORE (aod_data->aod_model), &iter,
-					    0, file_info->name,
-					    1, full_path,
-					    -1);
-			g_free (full_path);
+	file = g_file_new_for_path (options_dir);
+	fileenum = g_file_enumerate_children (file,
+			G_FILE_ATTRIBUTE_STANDARD_NAME,
+			0, NULL, &err);
+
+	if (err) {
+		g_warning ("Failed to enumerate children in %s: %s",
+				options_dir, err->message);
+		g_error_free (err);
+		return;
+	}
+
+
+	while ((info = g_file_enumerator_next_file(fileenum, NULL, &err))
+			!= NULL) {
+		const char *name;
+		char       *full_path;
+		GtkTreeIter iter;
+
+		if (err) {
+			g_warning ("Failed to get info while enumerating: %s",
+					err->message);
+			g_clear_error (&err);
+			continue;
 		}
+
+		name = g_file_info_get_name (info);
+		if (strcmp (name, ".") == 0 || strcmp (name, "..") == 0)
+			continue;
+		
+		full_path = g_build_filename (options_dir,
+				name, NULL);
+		
+		gtk_list_store_append (GTK_LIST_STORE (aod_data->aod_model),
+				&iter);
+		gtk_list_store_set (GTK_LIST_STORE (aod_data->aod_model), &iter,
+				    0, name,
+				    1, full_path,
+				    -1);
+		g_free (full_path);
+		g_object_unref (info);
+	}
+
+	if (err) {
+		g_warning ("Failed to get info after enumeration: %s",
+				err->message);
+		g_clear_error (&err);
 	}
 
-	gnome_vfs_file_info_list_free (list);
 	g_free (options_dir);
+	g_object_unref (fileenum);
+	g_object_unref (file);
 }
 
 
@@ -575,6 +599,8 @@ aod_remove_cb (GtkWidget             *widget,
 	GtkTreeSelection *selection;
 	GtkTreeIter       iter;
 	char             *file_path;
+	GFile            *file;
+	GError           *err = NULL;
 
 	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (aod_data->aod_treeview));
 	if (! gtk_tree_selection_get_selected (selection, NULL, &iter))
@@ -585,7 +611,14 @@ aod_remove_cb (GtkWidget             *widget,
 			    -1);
 	gtk_list_store_remove (GTK_LIST_STORE (aod_data->aod_model), &iter);
 
-	gnome_vfs_unlink (file_path);
+	file = g_file_new_for_path (file_path);
+	g_file_delete (file, NULL, &err);
+	if (err) {
+		g_warning ("Failed to delete file %s: %s",
+				file_path, err->message);
+		g_clear_error(&err);
+	}
+	g_object_unref (file);
 	g_free (file_path);
 }
 

commit ecda1b75d241fab00c8e62e9c0d55428ece90490
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Tue Mar 11 15:20:29 2008 +0100

    Switch deletion of old archive (to be overwritten) to gio.

diff --git a/src/actions.c b/src/actions.c
index 79fd79b..be48d9a 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -191,7 +191,8 @@ get_archive_filename_from_selector (FrWindow  *window,
 	if (path_is_file (path)) {
 		GtkWidget      *dialog;
 		int             r;
-		GnomeVFSResult  result;
+		GFile          *file;
+		GError         *err = NULL;
 
 		if (! is_supported_extension (file_sel, path)) {
 			dialog = _gtk_error_dialog_new (GTK_WINDOW (file_sel),
@@ -224,17 +225,20 @@ get_archive_filename_from_selector (FrWindow  *window,
 			return NULL;
 		}
 
-		result = gnome_vfs_unlink (path);
-		if (result != GNOME_VFS_OK) {
+		file = g_file_new_for_path (path);
+		g_file_delete (file, NULL, &err);
+		g_object_unref (file);
+		if (err) {
 			GtkWidget *dialog;
 			dialog = _gtk_error_dialog_new (GTK_WINDOW (file_sel),
 							GTK_DIALOG_DESTROY_WITH_PARENT,
 							NULL,
 							_("Could not delete the old archive."),
-							gnome_vfs_result_to_string (result));
+							err->message);
 			gtk_dialog_run (GTK_DIALOG (dialog));
 			gtk_widget_destroy (GTK_WIDGET (dialog));
 			g_free (path);
+			g_error_free (err);
 			return NULL;
 		}
 	}

commit b65724a6e68fc81cc1507785805ef901a22441f7
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Tue Mar 11 12:52:09 2008 +0100

    Argh, Some callers of path_is_file sends in uris!
    
    Try to see if we can fix this...

diff --git a/src/file-utils.c b/src/file-utils.c
index 44d1de0..9593a4b 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -92,7 +92,11 @@ path_is_filetype (const char *path, GFileType ft)
 	if (! path || ! *path)
 		return FALSE;
 
-	file = g_file_new_for_path (path);
+	if (*path == '/')
+		file = g_file_new_for_path (path);
+	else
+		file = g_file_new_for_uri (path);
+
 	info = g_file_query_info (file,
 			G_FILE_ATTRIBUTE_STANDARD_TYPE, 0, NULL, &err);
 

commit 7f2eeffc7b34ad8429dd3880045b27030da8583e
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Tue Mar 11 11:24:31 2008 +0100

    Use g_file_new_for_path in path_is_... to be able to query for filetype.
    
    Creating an uri can take a path, but then you get "Operation not supported"
    when querying for filetype.... pretty obivous since there's no good way to
    check remote files for type without first downloading them I guess.

diff --git a/src/file-utils.c b/src/file-utils.c
index ec14ef3..44d1de0 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -82,25 +82,25 @@ uri_exists (const char  *uri)
 }
 
 static gboolean
-path_is_filetype (const char *uri, GFileType ft)
+path_is_filetype (const char *path, GFileType ft)
 {
 	GFile     *file;
 	GFileInfo *info;
 	GError    *err = NULL;
 	gboolean   is_ft = FALSE;
 
-	if (! uri || ! *uri)
+	if (! path || ! *path)
 		return FALSE;
 
-	file = g_file_new_for_uri (uri);
+	file = g_file_new_for_path (path);
 	info = g_file_query_info (file,
 			G_FILE_ATTRIBUTE_STANDARD_TYPE, 0, NULL, &err);
 
 	if (!err) {
 		is_ft = (g_file_info_get_file_type (info) == ft);
 	} else {
-		g_warning ("Failed to get file type for uri %s: %s",
-				uri, err->message);
+		g_warning ("Failed to get file type for path %s: %s",
+				path, err->message);
 		g_error_free (err);
 	}
 
@@ -113,16 +113,16 @@ path_is_filetype (const char *uri, GFileType ft)
 
 
 gboolean
-path_is_file (const char *uri)
+path_is_file (const char *path)
 {
-	return path_is_filetype (uri, G_FILE_TYPE_REGULAR);
+	return path_is_filetype (path, G_FILE_TYPE_REGULAR);
 }
 
 
 gboolean
-path_is_dir (const char *uri)
+path_is_dir (const char *path)
 {
-	return path_is_filetype (uri, G_FILE_TYPE_DIRECTORY);
+	return path_is_filetype (path, G_FILE_TYPE_DIRECTORY);
 }
 
 

commit 3d63f4697e809883610f3cc8b4d429005142cbb7
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Mon Mar 10 21:02:20 2008 +0100

    Break long lines to fix syntax.

diff --git a/src/file-utils.c b/src/file-utils.c
index e4224d0..ec14ef3 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -99,7 +99,8 @@ path_is_filetype (const char *uri, GFileType ft)
 	if (!err) {
 		is_ft = (g_file_info_get_file_type (info) == ft);
 	} else {
-		g_warning ("Failed to get file type for uri %s: %s", uri, err->message);
+		g_warning ("Failed to get file type for uri %s: %s",
+				uri, err->message);
 		g_error_free (err);
 	}
 
@@ -162,8 +163,8 @@ dir_contains_one_object (const char *uri)
 	int              n = 0;
 
 	file = g_file_new_for_uri (uri);
-	fileenum = g_file_enumerate_children (file, G_FILE_ATTRIBUTE_STANDARD_NAME,
-			0, NULL, &err);
+	fileenum = g_file_enumerate_children (file,
+			G_FILE_ATTRIBUTE_STANDARD_NAME, 0, NULL, &err);
 
 	if (err) {
 		g_warning ("Failed to enumerate children of %s: %s",
@@ -174,7 +175,8 @@ dir_contains_one_object (const char *uri)
 		return FALSE;
 	}
 
-	while ((info = g_file_enumerator_next_file (fileenum, NULL, &err)) != NULL) {
+	while ((info = g_file_enumerator_next_file (fileenum, NULL, &err))
+				!= NULL) {
 		const char *name;
 
 		if (err) {
@@ -213,13 +215,15 @@ get_directory_content_if_unique (const char  *uri)
 	GnomeVFSFileInfo        *info;
 	char                    *content_uri = NULL;
 	
-	result = gnome_vfs_directory_open (&handle, uri, GNOME_VFS_FILE_INFO_DEFAULT);
+	result = gnome_vfs_directory_open (&handle, uri,
+			GNOME_VFS_FILE_INFO_DEFAULT);
 	if (result != GNOME_VFS_OK)
 		return NULL;
 	
 	info = gnome_vfs_file_info_new ();
 	while (gnome_vfs_directory_read_next (handle, info) == GNOME_VFS_OK) {
-		if ((strcmp (info->name, ".") == 0) || (strcmp (info->name, "..") == 0))
+		if ((strcmp (info->name, ".") == 0)
+				|| (strcmp (info->name, "..") == 0))
 			continue;
 		if (content_uri != NULL) {
 			g_free (content_uri);

commit 22ff41e40faa0c6c09b15895e96df30fcf57600a
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Mon Mar 10 21:01:11 2008 +0100

    Use g_file_new_for_uri to allow f-r to take both paths and uris as commandline args.

diff --git a/src/main.c b/src/main.c
index 0428c85..0b93247 100644
--- a/src/main.c
+++ b/src/main.c
@@ -591,7 +591,7 @@ prepare_app (void)
 			locale_archive = g_filename_from_utf8 (utf8_archive, -1, NULL, NULL, NULL);
 			if (locale_archive == NULL)
 				locale_archive = g_strdup (utf8_archive);
-			file = g_file_new_for_path (locale_archive);
+			file = g_file_new_for_uri (locale_archive);
 			uri = g_file_get_uri (file);
 			g_object_unref (file);
 			g_free (locale_archive);

commit 4eac7b565b210279356f6973da2ec22a31c7e1c2
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Mon Mar 10 15:35:32 2008 +0100

    Port get_file_*time helpers to gio.
    
    Port get_file_mtime helper to gio.
    Port get_file_ctime helper to gio.
    
    Add helper for getting file time.
    Use the same code to get creation and modification time of a file.

diff --git a/src/file-utils.c b/src/file-utils.c
index 0712bb5..e4224d0 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -297,54 +297,49 @@ get_file_size (const char *uri)
 	return size;
 }
 
-
-time_t
-get_file_mtime (const char *uri)
+static time_t
+get_file_time_type (const char *uri, const char *type)
 {
-	GnomeVFSFileInfo *info;
-	GnomeVFSResult    result;
-	time_t            mtime;
+	GFile     *file;
+	GFileInfo *info;
+	GError    *err = NULL;
+	time_t     time;
 
 	if ((uri == NULL) || (*uri == '\0'))
 		return 0;
 
-	info = gnome_vfs_file_info_new ();
-	result = gnome_vfs_get_file_info (uri,
-					  info,
-					  (GNOME_VFS_FILE_INFO_DEFAULT
-					   | GNOME_VFS_FILE_INFO_FOLLOW_LINKS));
-	mtime = 0;
-	if (result == GNOME_VFS_OK)
-		mtime = info->mtime;
+	file = g_file_new_for_uri (uri);
+	info = g_file_query_info (file, type, 0, NULL, &err);
 
-	gnome_vfs_file_info_unref (info);
+	if (!err) {
+		time = (time_t) g_file_info_get_attribute_uint64 (info,
+				type);
+	} else {
+		g_warning ("Failed to get %s for %s: %s",
+				type, uri, err->message);
+		g_error_free (err);
+		time = 0;
+	}
 
-	return mtime;
+	g_object_unref (info);
+	g_object_unref (file);
+
+	return time;
 }
 
 
+
 time_t
-get_file_ctime (const char *uri)
+get_file_mtime (const char *uri)
 {
-	GnomeVFSFileInfo *info;
-	GnomeVFSResult    result;
-	time_t            ctime;
-
-	if ((uri == NULL) || (*uri == '\0'))
-		return 0;
-
-	info = gnome_vfs_file_info_new ();
-	result = gnome_vfs_get_file_info (uri,
-					  info,
-					  (GNOME_VFS_FILE_INFO_DEFAULT
-					   | GNOME_VFS_FILE_INFO_FOLLOW_LINKS));
-	ctime = 0;
-	if (result == GNOME_VFS_OK)
-		ctime = info->ctime;
+	return get_file_time_type (uri, G_FILE_ATTRIBUTE_TIME_MODIFIED);
+}
 
-	gnome_vfs_file_info_unref (info);
 
-	return ctime;
+time_t
+get_file_ctime (const char *uri)
+{
+	return get_file_time_type (uri, G_FILE_ATTRIBUTE_TIME_CREATED);
 }
 
 

commit f78faeea44eff339f28dababf3df06c71ce85c8f
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Mon Mar 10 14:57:33 2008 +0100

    Move internal helper function and fix cut'n'paste error.
    
    path_is_filetype needs to be before the functions that use it....

diff --git a/src/file-utils.c b/src/file-utils.c
index fb7d8cf..0712bb5 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -81,20 +81,6 @@ uri_exists (const char  *uri)
 	return exists;	
 }
 
-
-gboolean
-path_is_file (const char *uri)
-{
-	return path_is_filetype (uri, G_FILE_TYPE_REGULAR);
-}
-
-
-gboolean
-path_is_dir (const char *uri)
-{
-	return path_is_filetype (uri, G_FILE_TYPE_DIRECTORY);
-}
-
 static gboolean
 path_is_filetype (const char *uri, GFileType ft)
 {
@@ -120,7 +106,22 @@ path_is_filetype (const char *uri, GFileType ft)
 	g_object_unref (info);
 	g_object_unref (file);
 
-	return is_dir;
+	return is_ft;
+}
+
+
+
+gboolean
+path_is_file (const char *uri)
+{
+	return path_is_filetype (uri, G_FILE_TYPE_REGULAR);
+}
+
+
+gboolean
+path_is_dir (const char *uri)
+{
+	return path_is_filetype (uri, G_FILE_TYPE_DIRECTORY);
 }
 
 

commit 4d04a713992dade88c68986fe3b7ce94aa6e63c0
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Mon Mar 10 14:54:55 2008 +0100

    Port uri_exists, path_is_*, and dir_contains_one_object functions to gio.

diff --git a/src/file-utils.c b/src/file-utils.c
index 01aef81..fb7d8cf 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -56,21 +56,27 @@
 gboolean
 uri_exists (const char  *uri)
 {
-	GnomeVFSFileInfo *info;
-	GnomeVFSResult    result;
-	gboolean          exists;
+	GFile     *file;
+	GFileInfo *info;
+	GError    *err = NULL;
+	gboolean   exists;
 
 	if (uri == NULL) 
 		return FALSE;
 
-	info = gnome_vfs_file_info_new ();
-	result = gnome_vfs_get_file_info (uri,
-					  info,
-					  GNOME_VFS_FILE_INFO_DEFAULT);
+	file = g_file_new_for_uri (uri);
+	info = g_file_query_info (file,
+			G_FILE_ATTRIBUTE_STANDARD_NAME, 0, NULL, &err);
 
-	exists = (result == GNOME_VFS_OK);
+	if (!err) {
+		exists = TRUE;
+	} else {
+		exists = FALSE;
+		g_error_free (err);
+	}
 
-	gnome_vfs_file_info_unref (info);
+	g_object_unref (info);
+	g_object_unref (file);
 
 	return exists;	
 }
@@ -79,48 +85,40 @@ uri_exists (const char  *uri)
 gboolean
 path_is_file (const char *uri)
 {
-	GnomeVFSFileInfo *info;
-	GnomeVFSResult    result;
-	gboolean          is_file;
-
-	if (! uri || ! *uri)
-		return FALSE;
-
-	info = gnome_vfs_file_info_new ();
-	result = gnome_vfs_get_file_info (uri,
-					  info,
-					  (GNOME_VFS_FILE_INFO_DEFAULT
-					   | GNOME_VFS_FILE_INFO_FOLLOW_LINKS));
-	is_file = FALSE;
-	if (result == GNOME_VFS_OK)
-		is_file = (info->type == GNOME_VFS_FILE_TYPE_REGULAR);
-
-	gnome_vfs_file_info_unref (info);
-
-	return is_file;
+	return path_is_filetype (uri, G_FILE_TYPE_REGULAR);
 }
 
 
 gboolean
 path_is_dir (const char *uri)
 {
-	GnomeVFSFileInfo *info;
-	GnomeVFSResult    result;
-	gboolean          is_dir;
+	return path_is_filetype (uri, G_FILE_TYPE_DIRECTORY);
+}
+
+static gboolean
+path_is_filetype (const char *uri, GFileType ft)
+{
+	GFile     *file;
+	GFileInfo *info;
+	GError    *err = NULL;
+	gboolean   is_ft = FALSE;
 
 	if (! uri || ! *uri)
 		return FALSE;
 
-	info = gnome_vfs_file_info_new ();
-	result = gnome_vfs_get_file_info (uri,
-					  info,
-					  (GNOME_VFS_FILE_INFO_DEFAULT
-					   | GNOME_VFS_FILE_INFO_FOLLOW_LINKS));
-	is_dir = FALSE;
-	if (result == GNOME_VFS_OK)
-		is_dir = (info->type == GNOME_VFS_FILE_TYPE_DIRECTORY);
+	file = g_file_new_for_uri (uri);
+	info = g_file_query_info (file,
+			G_FILE_ATTRIBUTE_STANDARD_TYPE, 0, NULL, &err);
 
-	gnome_vfs_file_info_unref (info);
+	if (!err) {
+		is_ft = (g_file_info_get_file_type (info) == ft);
+	} else {
+		g_warning ("Failed to get file type for uri %s: %s", uri, err->message);
+		g_error_free (err);
+	}
+
+	g_object_unref (info);
+	g_object_unref (file);
 
 	return is_dir;
 }
@@ -156,25 +154,52 @@ dir_is_empty (const char *path)
 gboolean
 dir_contains_one_object (const char *uri)
 {
-	GnomeVFSDirectoryHandle *handle;
-	GnomeVFSResult           result;
-	int                      n;
-	GnomeVFSFileInfo         info;
-	
-	result = gnome_vfs_directory_open (&handle, uri, GNOME_VFS_FILE_INFO_DEFAULT);
-	if (result != GNOME_VFS_OK)
+	GFile           *file;
+	GFileEnumerator *fileenum;
+	GFileInfo       *info;
+	GError          *err = NULL;
+	int              n = 0;
+
+	file = g_file_new_for_uri (uri);
+	fileenum = g_file_enumerate_children (file, G_FILE_ATTRIBUTE_STANDARD_NAME,
+			0, NULL, &err);
+
+	if (err) {
+		g_warning ("Failed to enumerate children of %s: %s",
+				uri, err->message);
+		g_error_free (err);
+		g_object_unref (fileenum);
+		g_object_unref (file);
 		return FALSE;
-		
-	n = 0;
-	while (gnome_vfs_directory_read_next (handle, &info) == GNOME_VFS_OK) {
-		if ((strcmp (info.name, ".") == 0) || (strcmp (info.name, "..") == 0))
+	}
+
+	while ((info = g_file_enumerator_next_file (fileenum, NULL, &err)) != NULL) {
+		const char *name;
+
+		if (err) {
+			g_warning ("Encountered error while enumerating children of %s, ignoring: %s",
+					uri, err->message);
+			g_error_free (err);
+			g_object_unref (info);
+			continue;
+		}
+
+		name = g_file_info_get_name (info);
+
+		if (strcmp (name, ".") == 0 || strcmp (name, "..") == 0) {
+			g_object_unref (info);
 			continue;
-		if (++n > 1) 
+		}
+
+		g_object_unref (info);
+
+		if (++n > 1)
 			break;
 	}
 
-	gnome_vfs_directory_close (handle);
-	
+	g_object_unref (file);
+	g_object_unref (fileenum);
+
 	return (n == 1);
 }
 

commit c03459acf68b6a7e6a6c2754faaa6e0fc2c5d604
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Mon Mar 10 13:15:10 2008 +0100

    Drop path_exists util function and use glibs g_file_test function.
    
    Get rid of second user of path_exists function as well.

diff --git a/src/file-utils.c b/src/file-utils.c
index e403da2..01aef81 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -54,32 +54,6 @@
 
 
 gboolean
-path_exists (const gchar *path)
-{
-	GnomeVFSFileInfo *info;
-	GnomeVFSResult result;
-	gboolean exists;
-	gchar *escaped;
-
-	if (! path || ! *path) return FALSE;
-
-	info = gnome_vfs_file_info_new ();
-	escaped = gnome_vfs_escape_path_string (path);
-	result = gnome_vfs_get_file_info (escaped,
-					  info,
-					  (GNOME_VFS_FILE_INFO_DEFAULT
-					   | GNOME_VFS_FILE_INFO_FOLLOW_LINKS));
-
-	exists = (result == GNOME_VFS_OK);
-
-	g_free (escaped);
-	gnome_vfs_file_info_unref (info);
-
-	return exists;
-}
-
-
-gboolean
 uri_exists (const char  *uri)
 {
 	GnomeVFSFileInfo *info;
diff --git a/src/file-utils.h b/src/file-utils.h
index 4acd774..ccfb3de 100644
--- a/src/file-utils.h
+++ b/src/file-utils.h
@@ -38,7 +38,6 @@
 		     NULL)
 
 gboolean            path_is_file                 (const gchar *s);
-gboolean            path_exists                  (const gchar *s);
 gboolean            uri_exists                   (const char  *uri);
 gboolean            path_is_dir                  (const gchar *s);
 gboolean            dir_is_empty                 (const gchar *s);
diff --git a/src/fr-archive.c b/src/fr-archive.c
index b713828..b845fdd 100644
--- a/src/fr-archive.c
+++ b/src/fr-archive.c
@@ -3146,13 +3146,13 @@ fr_archive_extract_to_local (FrArchive  *archive,
 
 		if (! archive->command->propExtractCanSkipOlder
 		    && skip_older
-		    && path_exists (dest_filename)
+		    && g_file_test (dest_filename, G_FILE_TEST_EXISTS)
 		    && (fdata->modified < get_file_mtime (dest_filename)))
 			continue;
 
 		if (! archive->command->propExtractCanAvoidOverwrite
 		    && ! overwrite
-		    && path_exists (dest_filename))
+		    && g_file_test (dest_filename, G_FILE_TEST_EXISTS))
 			continue;
 
 		filtered = g_list_prepend (filtered, fdata->original_path);

commit c490b63e144b34fd8b49c227afc1796f66ca9410
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Mon Mar 10 13:05:48 2008 +0100

    It's g_format_size_for_display nowadays...

diff --git a/src/dlg-prop.c b/src/dlg-prop.c
index f6e73ef..626b083 100644
--- a/src/dlg-prop.c
+++ b/src/dlg-prop.c
@@ -150,7 +150,7 @@ dlg_prop (FrWindow *window)
 
 	label = glade_xml_get_widget (data->gui, "p_size_label");
 	size = get_file_size (fr_window_get_archive_uri (window));
-	s = g_file_size_format_for_display (size);
+	s = g_format_size_for_display (size);
 	gtk_label_set_text (GTK_LABEL (label), s);
 	g_free (s);
 
@@ -170,7 +170,7 @@ dlg_prop (FrWindow *window)
 	}
 
 	label = glade_xml_get_widget (data->gui, "p_uncomp_size_label");
-	s = g_file_size_format_for_display (uncompressed_size);
+	s = g_format_size_for_display (uncompressed_size);
 	gtk_label_set_text (GTK_LABEL (label), s);
 	g_free (s);
 
diff --git a/src/fr-window.c b/src/fr-window.c
index d468f5b..6c8c779 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -1437,8 +1437,8 @@ fr_window_update_statusbar_list_info (FrWindow *window)
 		g_list_free (selection);
 	}
 
-	size_txt = g_file_size_format_for_display (tot_size);
-	sel_size_txt = g_file_size_format_for_display (sel_size);
+	size_txt = g_format_size_for_display (tot_size);
+	sel_size_txt = g_format_size_for_display (sel_size);
 
 	if (tot_n == 0)
 		archive_info = g_strdup ("");
@@ -1504,7 +1504,7 @@ fr_window_populate_file_list (FrWindow  *window,
 			utf8_path = g_filename_display_name (tmp);
 			g_free (tmp);
 
-			s_size = g_file_size_format_for_display (fdata->dir_size);
+			s_size = g_format_size_for_display (fdata->dir_size);
 				
 			if (fdata->list_dir) 
 				s_time = g_strdup ("");
@@ -1533,7 +1533,7 @@ fr_window_populate_file_list (FrWindow  *window,
 
 			utf8_path = g_filename_display_name (fdata->path);
 
-			s_size = g_file_size_format_for_display (fdata->size);
+			s_size = g_format_size_for_display (fdata->size);
 			s_time = get_time_string (fdata->modified);
 			desc = file_data_get_mime_type_description (fdata);
 

commit 7253e6d35e6cc76d72eac6420eb4766869bed34e
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Fri Feb 29 09:19:04 2008 +0100

    Also add gio.h include in src/file-utils.c

diff --git a/src/file-utils.c b/src/file-utils.c
index 942b3a9..e403da2 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -37,6 +37,7 @@
 #include <glib.h>
 #include <libgnomevfs/gnome-vfs.h>
 #include <libgnomevfs/gnome-vfs-mime.h>
+#include <gio/gio.h>
 #include <gconf/gconf-client.h>
 #include "file-utils.h"
 #include "glib-utils.h"

commit a3d34e5509469a721b32b7aaaee4153fc539502d
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Fri Feb 29 09:17:49 2008 +0100

    Switch get_dest_free_space helper to gio and update caller.

diff --git a/src/file-utils.c b/src/file-utils.c
index 2e7bf75..942b3a9 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -716,21 +716,32 @@ path_list_dup (GList *path_list)
 }
 
 
-GnomeVFSFileSize
+guint64
 get_dest_free_space (const char *uri)
 {
-	GnomeVFSURI      *vfs_uri;
-	GnomeVFSResult    result;
-	GnomeVFSFileSize  ret_val;
+	GFile            *file;
+	GFileInfo        *info;
+	goffset           freespace;
+	GError           *err = NULL;
 
-	vfs_uri = gnome_vfs_uri_new (uri);
-	result = gnome_vfs_get_volume_free_space (vfs_uri, &ret_val);
-	gnome_vfs_uri_unref (vfs_uri);
+	file = g_file_new_for_uri (uri);
+	info = g_file_query_info (file, G_FILE_ATTRIBUTE_FILESYSTEM_FREE,
+			0, NULL, &err);
 
-	if (result != GNOME_VFS_OK)
-		return (GnomeVFSFileSize) 0;
-	else
-		return ret_val;
+	if (!err) {
+		freespace = g_file_info_get_attribute_uint64 (info,
+				G_FILE_ATTRIBUTE_FILESYSTEM_FREE);
+	} else {
+		freespace = 0;
+		g_warning ("Could not get filesystem free space on volume that contains %s: %s",
+				uri, err->message);
+		g_error_free (err);
+	}
+
+	g_object_unref (info);
+	g_object_unref (file);
+
+	return freespace;
 }
 
 
@@ -914,7 +925,7 @@ get_folder_from_try_folder_list (int n)
 char *
 get_temp_work_dir (void)
 {
-	GnomeVFSFileSize  max_size = 0;
+	guint64           max_size = 0;
 	char             *best_folder = NULL;
 	int               i;
 	char             *template;
@@ -925,7 +936,7 @@ get_temp_work_dir (void)
 	for (i = 0; try_folder[i] != NULL; i++) {
 		const char       *folder;
 		char             *uri;
-		GnomeVFSFileSize  size;
+		guint64           size;
 
 		folder = get_folder_from_try_folder_list (i);
 		uri = g_strconcat ("file://", folder, NULL);
diff --git a/src/file-utils.h b/src/file-utils.h
index a2a2c9b..4acd774 100644
--- a/src/file-utils.h
+++ b/src/file-utils.h
@@ -70,7 +70,7 @@ gboolean            is_mime_type                 (const char* type,
 						  const char* pattern);
 const char*         get_file_mime_type           (const char *filename,
                     				  gboolean    fast_file_type);
-GnomeVFSFileSize    get_dest_free_space          (const char  *path);
+guint64             get_dest_free_space          (const char  *path);
 gboolean            remove_directory             (const char  *uri);
 gboolean            remove_local_directory       (const char  *directory);
 GnomeVFSResult      make_tree                    (const char  *uri);

commit 06759a2776d469c333172dc9f7306108050a3b67
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Fri Feb 29 08:59:16 2008 +0100

    Switch get_file_size helper and users to use g_file_size_format_for_display.

diff --git a/src/dlg-prop.c b/src/dlg-prop.c
index 82c65a9..f6e73ef 100644
--- a/src/dlg-prop.c
+++ b/src/dlg-prop.c
@@ -86,7 +86,7 @@ dlg_prop (FrWindow *window)
 	GtkWidget        *label_label;
 	GtkWidget        *label;
 	char             *s;
-	GnomeVFSFileSize  size, uncompressed_size;
+	goffset           size, uncompressed_size;
 	char             *utf8_name;
 	char             *title_txt;
 	double            ratio;
@@ -150,7 +150,7 @@ dlg_prop (FrWindow *window)
 
 	label = glade_xml_get_widget (data->gui, "p_size_label");
 	size = get_file_size (fr_window_get_archive_uri (window));
-	s = gnome_vfs_format_file_size_for_display (size);
+	s = g_file_size_format_for_display (size);
 	gtk_label_set_text (GTK_LABEL (label), s);
 	g_free (s);
 
@@ -170,7 +170,7 @@ dlg_prop (FrWindow *window)
 	}
 
 	label = glade_xml_get_widget (data->gui, "p_uncomp_size_label");
-	s = gnome_vfs_format_file_size_for_display (uncompressed_size);
+	s = g_file_size_format_for_display (uncompressed_size);
 	gtk_label_set_text (GTK_LABEL (label), s);
 	g_free (s);
 
diff --git a/src/file-data.h b/src/file-data.h
index b690098..3b174ef 100644
--- a/src/file-data.h
+++ b/src/file-data.h
@@ -31,14 +31,14 @@ typedef struct {
 	char       *original_path;    /* path read from command line. */
 	char       *full_path;        /* "/" + original_path. */
 	char       *link;
-	guint64     size;
+	goffset     size;
 	time_t      modified;
 
 	char       *name;             /* The file name. */
 	char       *path;             /* The directory. */
 	gboolean    encrypted;        /* Whether the file is encrypted. */
 	gboolean    dir;              /* Whether this is a directory listed in the archive */
-	guint64     dir_size;
+	goffset     dir_size;
 	
 	/* Additional data. */
 
diff --git a/src/file-utils.c b/src/file-utils.c
index 6c05409..2e7bf75 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -267,26 +267,31 @@ path_in_path (const char *dirname,
 }
 
 
-GnomeVFSFileSize
+goffset
 get_file_size (const char *uri)
 {
-	GnomeVFSFileInfo *info;
-	GnomeVFSResult    result;
-	GnomeVFSFileSize  size;
+	GFile     *file;
+	GFileInfo *info;
+	goffset    size;
+	GError    *err = NULL;
 
 	if ((uri == NULL) || (*uri == '\0'))
 		return 0;
 
-	info = gnome_vfs_file_info_new ();
-	result = gnome_vfs_get_file_info (uri,
-					  info,
-					  (GNOME_VFS_FILE_INFO_DEFAULT
-					   | GNOME_VFS_FILE_INFO_FOLLOW_LINKS));
-	size = 0;
-	if (result == GNOME_VFS_OK)
-		size = info->size;
+	file = g_file_new_for_uri (uri);
+	info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_SIZE,
+			0, NULL, &err);
 
-	gnome_vfs_file_info_unref (info);
+	if (!err) {
+		size = g_file_info_get_size (info);
+	} else {
+		g_warning ("Failed to get file size for %s: %s",
+				uri, err->message);
+		g_error_free (err);
+	}
+
+	g_object_unref (info);
+	g_object_unref (file);
 
 	return size;
 }
diff --git a/src/file-utils.h b/src/file-utils.h
index 4e3d1c5..a2a2c9b 100644
--- a/src/file-utils.h
+++ b/src/file-utils.h
@@ -46,7 +46,7 @@ gboolean            dir_contains_one_object      (const char  *uri);
 char *              get_directory_content_if_unique (const char  *uri);
 gboolean            path_in_path                 (const char  *path_src,
 						  const char  *path_dest);
-GnomeVFSFileSize    get_file_size                (const gchar *s);
+goffset             get_file_size                (const gchar *s);
 time_t              get_file_mtime               (const gchar *s);
 time_t              get_file_ctime               (const gchar *s);
 gboolean            file_copy                    (const gchar *from,

commit 90684381dd14fc18138b0ca3d51823498911fc3d
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Fri Feb 29 08:46:12 2008 +0100

    Switch src/fr-window.c to g_file_size_format_for_display

diff --git a/src/fr-window.c b/src/fr-window.c
index 20293c6..d468f5b 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -34,6 +34,7 @@
 #include <libgnomevfs/gnome-vfs-ops.h>
 #include <libgnomevfs/gnome-vfs-uri.h>
 #include <libgnomevfs/gnome-vfs-utils.h>
+#include <gio/gio.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 
 #include "actions.h"
@@ -1390,7 +1391,7 @@ fr_window_update_statusbar_list_info (FrWindow *window)
 	char             *info, *archive_info, *selected_info;
 	char             *size_txt, *sel_size_txt;
 	int               tot_n, sel_n;
-	GnomeVFSFileSize  tot_size, sel_size;
+	goffset           tot_size, sel_size;
 	GList            *scan;
 	
 	if (window == NULL)
@@ -1436,8 +1437,8 @@ fr_window_update_statusbar_list_info (FrWindow *window)
 		g_list_free (selection);
 	}
 
-	size_txt = gnome_vfs_format_file_size_for_display (tot_size);
-	sel_size_txt = gnome_vfs_format_file_size_for_display (sel_size);
+	size_txt = g_file_size_format_for_display (tot_size);
+	sel_size_txt = g_file_size_format_for_display (sel_size);
 
 	if (tot_n == 0)
 		archive_info = g_strdup ("");
@@ -1503,7 +1504,7 @@ fr_window_populate_file_list (FrWindow  *window,
 			utf8_path = g_filename_display_name (tmp);
 			g_free (tmp);
 
-			s_size = gnome_vfs_format_file_size_for_display (fdata->dir_size);
+			s_size = g_file_size_format_for_display (fdata->dir_size);
 				
 			if (fdata->list_dir) 
 				s_time = g_strdup ("");
@@ -1532,7 +1533,7 @@ fr_window_populate_file_list (FrWindow  *window,
 
 			utf8_path = g_filename_display_name (fdata->path);
 
-			s_size = gnome_vfs_format_file_size_for_display (fdata->size);
+			s_size = g_file_size_format_for_display (fdata->size);
 			s_time = get_time_string (fdata->modified);
 			desc = file_data_get_mime_type_description (fdata);
 

commit 8afbfa6ec834ce18eef819f22145077e7f9d00c0
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Fri Feb 29 00:32:26 2008 +0100

    Rerun autogen to update src/Makefile.in after gnome-vfs-utils removal.

diff --git a/src/Makefile.in b/src/Makefile.in
index d55d117..63c2d60 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -67,9 +67,8 @@ am__file_roller_SOURCES_DIST = actions.h actions.c bookmarks.c \
 	fr-error.h fr-list-model.c fr-list-model.h fr-stock.c \
 	fr-stock.h fr-process.c fr-process.h fr-window.c fr-window.h \
 	gconf-utils.c gconf-utils.h glib-utils.c glib-utils.h \
-	gnome-vfs-helpers.c gnome-vfs-helpers.h gtk-utils.c \
-	gtk-utils.h java-utils.c java-utils.h main.c main.h \
-	open-file.c open-file.h preferences.c preferences.h \
+	gtk-utils.c gtk-utils.h java-utils.c java-utils.h main.c \
+	main.h open-file.c open-file.h preferences.c preferences.h \
 	sexy-icon-entry.c sexy-icon-entry.h typedefs.h ui.h \
 	utf8-fnmatch.c utf8-fnmatch.h mkdtemp.c mkdtemp.h fr-marshal.c \
 	fr-marshal.h
@@ -93,9 +92,8 @@ am_file_roller_OBJECTS = actions.$(OBJEXT) bookmarks.$(OBJEXT) \
 	fr-command-zoo.$(OBJEXT) fr-command-7z.$(OBJEXT) \
 	fr-error.$(OBJEXT) fr-list-model.$(OBJEXT) fr-stock.$(OBJEXT) \
 	fr-process.$(OBJEXT) fr-window.$(OBJEXT) gconf-utils.$(OBJEXT) \
-	glib-utils.$(OBJEXT) gnome-vfs-helpers.$(OBJEXT) \
-	gtk-utils.$(OBJEXT) java-utils.$(OBJEXT) main.$(OBJEXT) \
-	open-file.$(OBJEXT) preferences.$(OBJEXT) \
+	glib-utils.$(OBJEXT) gtk-utils.$(OBJEXT) java-utils.$(OBJEXT) \
+	main.$(OBJEXT) open-file.$(OBJEXT) preferences.$(OBJEXT) \
 	sexy-icon-entry.$(OBJEXT) utf8-fnmatch.$(OBJEXT) \
 	$(am__objects_1) $(am__objects_2)
 file_roller_OBJECTS = $(am_file_roller_OBJECTS)
@@ -400,8 +398,6 @@ file_roller_SOURCES = \
 	gconf-utils.h			\
 	glib-utils.c			\
 	glib-utils.h			\
-	gnome-vfs-helpers.c		\
-	gnome-vfs-helpers.h		\
 	gtk-utils.c			\
 	gtk-utils.h			\
 	java-utils.c			\
@@ -537,7 +533,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fr-window.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gconf-utils.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glib-utils.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnome-vfs-helpers.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtk-utils.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java-utils.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@

commit 307ab96089b4647f77785aca7525ddaf4859f1f2
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Fri Feb 29 00:30:41 2008 +0100

    Delete unused src/gnome-vfs-utils.{c,h} and drop it from src/Makefile.am

diff --git a/src/Makefile.am b/src/Makefile.am
index 57da004..4a42f90 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -115,8 +115,6 @@ file_roller_SOURCES = 			\
 	gconf-utils.h			\
 	glib-utils.c			\
 	glib-utils.h			\
-	gnome-vfs-helpers.c		\
-	gnome-vfs-helpers.h		\
 	gtk-utils.c			\
 	gtk-utils.h			\
 	java-utils.c			\
diff --git a/src/gnome-vfs-helpers.c b/src/gnome-vfs-helpers.c
deleted file mode 100644
index b3ea316..0000000
--- a/src/gnome-vfs-helpers.c
+++ /dev/null
@@ -1,1548 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* gnome-vfs-helpers.c - gnome-vfs extensions formerly known as
-                         eel-vfs-extensions
-
-   Copyright (C) 1999, 2000 Eazel, Inc.
-   Copyright (C) 2001, Free Software Foundation
-
-   The Gnome Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   The Gnome Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the Gnome Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.
-
-   Authors: Darin Adler <darin@eazel.com>
-	    Pavel Cisler <pavel@eazel.com>
-	    Mike Fleming  <mfleming@eazel.com>
-            John Sullivan <sullivan@eazel.com>
-	    Seth Nickell <snickell@stanford.edu>
-*/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "gnome-vfs-helpers.h"
-
-#include <libgnomevfs/gnome-vfs-async-ops.h>
-#include <libgnomevfs/gnome-vfs-find-directory.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
-#include <libgnomevfs/gnome-vfs-uri.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-#include <libgnomevfs/gnome-vfs-xfer.h>
-#include <pthread.h>
-
-#include <string.h>
-
-#include <glib/gstrfuncs.h>
-#include <glib/gutils.h>
-
-
-#define READ_CHUNK_SIZE 8192
-
-struct GnomeVFSXReadFileHandle {
-	GnomeVFSAsyncHandle *handle;
-	GnomeVFSXReadFileCallback callback;
-	GnomeVFSXReadMoreCallback read_more_callback;
-	gpointer callback_data;
-	gboolean is_open;
-	char *buffer;
-	GnomeVFSFileSize bytes_read;
-};
-
-#undef PTHREAD_ASYNC_READ
-
-#ifndef PTHREAD_ASYNC_READ
-static void read_file_read_chunk (GnomeVFSXReadFileHandle *handle);
-#endif
-
-static int
-stolen_strcmp (const char *string_a, const char *string_b)
-{
-	return strcmp (string_a == NULL ? "" : string_a,
-		       string_b == NULL ? "" : string_b);
-}
-static gboolean
-str_is_equal (const char *string_a, const char *string_b)
-{
-	return stolen_strcmp (string_a, string_b) == 0;
-}
-
-static gboolean
-str_has_prefix (const char *haystack, const char *needle)
-{
-	const char *h, *n;
-
-	/* Eat one character at a time. */
-	h = haystack == NULL ? "" : haystack;
-	n = needle == NULL ? "" : needle;
-	do {
-		if (*n == '\0') {
-			return TRUE;
-		}
-		if (*h == '\0') {
-			return FALSE;
-		}
-	} while (*h++ == *n++);
-	return FALSE;
-}
-
-static gboolean
-istr_has_prefix (const char *haystack, const char *needle)
-{
-	const char *h, *n;
-	char hc, nc;
-
-	/* Eat one character at a time. */
-	h = haystack == NULL ? "" : haystack;
-	n = needle == NULL ? "" : needle;
-	do {
-		if (*n == '\0') {
-			return TRUE;
-		}
-		if (*h == '\0') {
-			return FALSE;
-		}
-		hc = *h++;
-		nc = *n++;
-		hc = g_ascii_tolower (hc);
-		nc = g_ascii_tolower (nc);
-	} while (hc == nc);
-	return FALSE;
-}
-
-
-GnomeVFSResult
-gnome_vfs_x_read_entire_file (const char *uri,
-			   int *file_size,
-			   char **file_contents)
-{
-	GnomeVFSResult result;
-	GnomeVFSHandle *handle;
-	char *buffer;
-	GnomeVFSFileSize total_bytes_read;
-	GnomeVFSFileSize bytes_read;
-
-	*file_size = 0;
-	*file_contents = NULL;
-
-	/* Open the file. */
-	result = gnome_vfs_open (&handle, uri, GNOME_VFS_OPEN_READ);
-	if (result != GNOME_VFS_OK) {
-		return result;
-	}
-
-	/* Read the whole thing. */
-	buffer = NULL;
-	total_bytes_read = 0;
-	do {
-		buffer = g_realloc (buffer, total_bytes_read + READ_CHUNK_SIZE);
-		result = gnome_vfs_read (handle,
-					 buffer + total_bytes_read,
-					 READ_CHUNK_SIZE,
-					 &bytes_read);
-		if ((result != GNOME_VFS_OK) && (result != GNOME_VFS_ERROR_EOF)) {
-			g_free (buffer);
-			gnome_vfs_close (handle);
-			return result;
-		}
-
-		/* Check for overflow. */
-		if ((total_bytes_read + bytes_read) < total_bytes_read) {
-			g_free (buffer);
-			gnome_vfs_close (handle);
-			return GNOME_VFS_ERROR_TOO_BIG;
-		}
-
-		total_bytes_read += bytes_read;
-
-		/*FIXME: I should not check bytes_read != 0, but there are problems with 
-		 * ftp
-		 */
-	} while ((result == GNOME_VFS_OK) && (bytes_read != 0));
-
-	/* Close the file. */
-
-	result = gnome_vfs_close (handle);
-	if (result != GNOME_VFS_OK) {
-		g_free (buffer);
-		return result;
-	}
-	
-	/* Return the file. */
-	*file_size = total_bytes_read;
-	*file_contents = g_realloc (buffer, total_bytes_read);
-	return GNOME_VFS_OK;
-}
-
-#ifndef PTHREAD_ASYNC_READ
-/* When close is complete, there's no more work to do. */
-static void
-read_file_close_callback (GnomeVFSAsyncHandle *handle,
-			  GnomeVFSResult result,
-			  gpointer callback_data)
-{
-}
-
-/* Do a close if it's needed.
- * Be sure to get this right, or we have extra threads hanging around.
- */
-static void
-read_file_close (GnomeVFSXReadFileHandle *read_handle)
-{
-	if (read_handle->is_open) {
-		gnome_vfs_async_close (read_handle->handle,
-				       read_file_close_callback,
-				       NULL);
-		read_handle->is_open = FALSE;
-	}
-}
-
-/* Close the file and then tell the caller we succeeded, handing off
- * the buffer to the caller.
- */
-static void
-read_file_succeeded (GnomeVFSXReadFileHandle *read_handle)
-{
-	read_file_close (read_handle);
-	
-	/* Reallocate the buffer to the exact size since it might be
-	 * around for a while.
-	 */
-	(* read_handle->callback) (GNOME_VFS_OK,
-				   read_handle->bytes_read,
-				   g_realloc (read_handle->buffer,
-					      read_handle->bytes_read),
-				   read_handle->callback_data);
-
-	g_free (read_handle);
-}
-
-/* Tell the caller we failed. */
-static void
-read_file_failed (GnomeVFSXReadFileHandle *read_handle, GnomeVFSResult result)
-{
-	read_file_close (read_handle);
-	g_free (read_handle->buffer);
-	
-	(* read_handle->callback) (result, 0, NULL, read_handle->callback_data);
-	g_free (read_handle);
-}
-
-/* A read is complete, so we might or might not be done. */
-static void
-read_file_read_callback (GnomeVFSAsyncHandle *handle,
-				GnomeVFSResult result,
-				gpointer buffer,
-				GnomeVFSFileSize bytes_requested,
-				GnomeVFSFileSize bytes_read,
-				gpointer callback_data)
-{
-	GnomeVFSXReadFileHandle *read_handle;
-	gboolean read_more;
-
-	/* Do a few reality checks. */
-	g_assert (bytes_requested == READ_CHUNK_SIZE);
-	read_handle = callback_data;
-	g_assert (read_handle->handle == handle);
-	g_assert (read_handle->buffer + read_handle->bytes_read == buffer);
-	g_assert (bytes_read <= bytes_requested);
-
-	/* Check for a failure. */
-	if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) {
-		read_file_failed (read_handle, result);
-		return;
-	}
-
-	/* Check for the extremely unlikely case where the file size overflows. */
-	if (read_handle->bytes_read + bytes_read < read_handle->bytes_read) {
-		read_file_failed (read_handle, GNOME_VFS_ERROR_TOO_BIG);
-		return;
-	}
-
-	/* Bump the size. */
-	read_handle->bytes_read += bytes_read;
-
-	/* Read more unless we are at the end of the file. */
-	if (bytes_read == 0 || result != GNOME_VFS_OK) {
-		read_more = FALSE;
-	} else {
-		if (read_handle->read_more_callback == NULL) {
-			read_more = TRUE;
-		} else {
-			read_more = (* read_handle->read_more_callback)
-				(read_handle->bytes_read,
-				 read_handle->buffer,
-				 read_handle->callback_data);
-		}
-	}
-	if (read_more) {
-		read_file_read_chunk (read_handle);
-		return;
-	}
-
-	/* If at the end of the file, we win! */
-	read_file_succeeded (read_handle);
-}
-
-/* Start reading a chunk. */
-static void
-read_file_read_chunk (GnomeVFSXReadFileHandle *handle)
-{
-	handle->buffer = g_realloc (handle->buffer, handle->bytes_read + READ_CHUNK_SIZE);
-	gnome_vfs_async_read (handle->handle,
-			      handle->buffer + handle->bytes_read,
-			      READ_CHUNK_SIZE,
-			      read_file_read_callback,
-			      handle);
-}
-
-/* Once the open is finished, read a first chunk. */
-static void
-read_file_open_callback (GnomeVFSAsyncHandle *handle,
-			 GnomeVFSResult result,
-			 gpointer callback_data)
-{
-	GnomeVFSXReadFileHandle *read_handle;
-	
-	read_handle = callback_data;
-	g_assert (read_handle->handle == handle);
-
-	/* Handle the failure case. */
-	if (result != GNOME_VFS_OK) {
-		read_file_failed (read_handle, result);
-		return;
-	}
-
-	/* Handle success by reading the first chunk. */
-	read_handle->is_open = TRUE;
-	read_file_read_chunk (read_handle);
-}
-
-#else
-
-typedef struct {
-	GnomeVFSXReadFileCallback callback;
-	GnomeVFSXReadMoreCallback more_callback;
-	gpointer callback_data;
-	pthread_mutex_t *callback_result_ready_semaphore;
-	gboolean synch_callback_result;
-
-	GnomeVFSResult result;
-	GnomeVFSFileSize file_size;
-	char *buffer;
-} GnomeVFSXAsyncReadFileCallbackData;
-
-static int
-pthread_gnome_vfs_x_read_file_callback_idle_binder (void *cast_to_context)
-{
-	GnomeVFSXAsyncReadFileCallbackData *context;
-	
-	context = (GnomeVFSXAsyncReadFileCallbackData *)cast_to_context;
-
-	if (context->more_callback) {
-		g_assert (context->callback_result_ready_semaphore != NULL);
-		/* Synchronous callback flavor, wait for the return value. */
-		context->synch_callback_result = (* context->more_callback) (context->file_size, 
-			context->buffer, context->callback_data);
-		/* Got the result, release the master thread */
-		pthread_mutex_unlock (context->callback_result_ready_semaphore);
-	} else {
-		/* Asynchronous callback flavor, don't wait for the result. */
-		(* context->callback) (context->result, context->file_size, 
-			context->buffer, context->callback_data);
-
-		/* We assume ownership of data here in the async call and have to
-		 * free it.
-		 */
-		g_free (context);
-	}
-
-	return FALSE;
-}
-
-static gboolean
-pthread_gnome_vfs_x_read_file_callback_common (GnomeVFSXReadFileCallback callback,
-	GnomeVFSXReadMoreCallback more_callback, gpointer callback_data, 
-	GnomeVFSResult error, GnomeVFSFileSize file_size,
-	char *buffer, pthread_mutex_t *callback_result_ready_semaphore)
-{
-	GnomeVFSXAsyncReadFileCallbackData *data;
-	gboolean result;
-
-	g_assert ((callback == NULL) != (more_callback == NULL));
-	g_assert ((more_callback != NULL) == (callback_result_ready_semaphore != NULL));
-
-	result = FALSE;
-	data = g_new0 (GnomeVFSXAsyncReadFileCallbackData, 1);
-	data->callback = callback;
-	data->more_callback = more_callback;
-	data->callback_data = callback_data;
-	data->callback_result_ready_semaphore = callback_result_ready_semaphore;
-	data->result = error;
-	data->file_size = file_size;
-	data->buffer = buffer;
-	
-	/* Set up the callback to get called in the main thread. */
-	g_idle_add (pthread_gnome_vfs_x_read_file_callback_idle_binder, data);
-
-	if (callback_result_ready_semaphore != NULL) {
-		/* Block until callback deposits the return value. This is not optimal but we do it
-		 * to emulate the gnome_vfs_x_read_file_async call behavior.
-		 */
-		pthread_mutex_lock (callback_result_ready_semaphore);
-		result = data->synch_callback_result;
-
-		/* In the synch call we still own data here and need to free it. */
-		g_free (data);
-
-	}
-
-	return result;
-}
-
-static gboolean
-pthread_gnome_vfs_x_read_file_synchronous_callback (GnomeVFSXReadMoreCallback callback,
-	gpointer callback_data, GnomeVFSFileSize file_size,
-	char *buffer, pthread_mutex_t *callback_result_ready_semaphore)
-{
-	return pthread_gnome_vfs_x_read_file_callback_common(NULL, callback,
-		callback_data, GNOME_VFS_OK, file_size, buffer, callback_result_ready_semaphore);
-}
-
-static void
-pthread_gnome_vfs_x_read_file_asynchronous_callback (GnomeVFSXReadFileCallback callback,
-	gpointer callback_data, GnomeVFSResult result, GnomeVFSFileSize file_size,
-	char *buffer)
-{
-	pthread_gnome_vfs_x_read_file_callback_common(callback, NULL,
-		callback_data, result, file_size, buffer, NULL);
-}
-
-typedef struct {
-	GnomeVFSXReadFileHandle handle;
-	char *uri;
-	volatile gboolean cancel_requested;
-	/* Expose the synch callback semaphore to allow the cancel call to unlock it. */
-	pthread_mutex_t *callback_result_ready_semaphore;
-} GnomeVFSXAsyncReadFileData;
-
-static void *
-pthread_gnome_vfs_x_read_file_thread_entry (void *cast_to_data)
-{
-	GnomeVFSXAsyncReadFileData *data;
-	GnomeVFSResult result;
-	char *buffer;
-	GnomeVFSFileSize total_bytes_read;
-	GnomeVFSFileSize bytes_read;
-	pthread_mutex_t callback_result_ready_semaphore;
-	
-	data = (GnomeVFSXAsyncReadFileData *)cast_to_data;
-	buffer = NULL;
-	total_bytes_read = 0;
-
-	result = gnome_vfs_open ((GnomeVFSHandle **)&data->handle.handle, data->uri, GNOME_VFS_OPEN_READ);
-	if (result == GNOME_VFS_OK) {
-	
-		if (data->handle.read_more_callback != NULL) {
-			/* read_more_callback is a synchronous callback, allocate a semaphore
-			 * to provide for synchoronization with the callback.
-			 * We are using the default mutex attributes that give us a fast mutex
-			 * that behaves like a semaphore.
-			 */
-			pthread_mutex_init (&callback_result_ready_semaphore, NULL);
-			/* Grab the semaphore -- the next lock will block us and
-			 * we will need the callback to unblock the semaphore.
-			 */
-			pthread_mutex_lock (&callback_result_ready_semaphore);
-			data->callback_result_ready_semaphore = &callback_result_ready_semaphore;
-		}
-		for (;;) {
-			if (data->cancel_requested) {
-				/* Cancelled by the master. */
-				result = GNOME_VFS_ERROR_INTERRUPTED;
-				break;
-			}
-
-			buffer = g_realloc (buffer, total_bytes_read + READ_CHUNK_SIZE);
-			/* FIXME bugzilla.eazel.com 5070:
-			 * For a better cancellation granularity we should use gnome_vfs_read_cancellable
-			 * here, adding a GnomeVFSContext to GnomeVFSXAsyncReadFileData.
-			 */
-			result = gnome_vfs_read ((GnomeVFSHandle *)data->handle.handle, buffer + total_bytes_read,
-				READ_CHUNK_SIZE, &bytes_read);
-
-			total_bytes_read += bytes_read;
-
-			if (data->cancel_requested) {
-				/* Cancelled by the master. */
-				result = GNOME_VFS_ERROR_INTERRUPTED;
-				break;
-			}
-
-			if (result != GNOME_VFS_OK) {
-				if (result == GNOME_VFS_ERROR_EOF) {
-					/* not really an error, just done reading */
-					result = GNOME_VFS_OK;
-				}
-				break;
-			}
-
-			if (data->handle.read_more_callback != NULL
-				&& !pthread_gnome_vfs_x_read_file_synchronous_callback (data->handle.read_more_callback,
-					data->handle.callback_data, total_bytes_read, buffer, 
-					&callback_result_ready_semaphore)) {
-				/* callback doesn't want any more data */
-				break;
-			}
-
-		}
-		gnome_vfs_close ((GnomeVFSHandle *)data->handle.handle);
-	}
-
-	if (result != GNOME_VFS_OK) {
-		/* Because of the error or cancellation, nobody will take the data we read, 
-		 * delete the buffer here instead.
-		 */
-		g_free (buffer);
-		buffer = NULL;
-		total_bytes_read = 0;
-	}
-
-	/* Call the final callback. 
-	 * If everything is OK, pass in the data read. 
-	 * We are handing off the read buffer -- trim it to the actual size we need first
-	 * so that it doesn't take up more space than needed.
-	 */
-	pthread_gnome_vfs_x_read_file_asynchronous_callback(data->handle.callback, 
-		data->handle.callback_data, result, total_bytes_read, 
-		g_realloc (buffer, total_bytes_read));
-
-	if (data->handle.read_more_callback != NULL) {
-		pthread_mutex_destroy (&callback_result_ready_semaphore);
-	}
-
-	g_free (data->uri);
-	g_free (data);
-
-	return NULL;
-}
-
-static GnomeVFSXReadFileHandle *
-pthread_gnome_vfs_x_read_file_async(const char *uri, GnomeVFSXReadFileCallback callback, 
-	GnomeVFSXReadMoreCallback read_more_callback, gpointer callback_data)
-{
-	GnomeVFSXAsyncReadFileData *data;
-	pthread_attr_t thread_attr;
-	pthread_t thread;
-
-	data = g_new0 (GnomeVFSXAsyncReadFileData, 1);
-
-	data->handle.callback = callback;
-	data->handle.read_more_callback = read_more_callback;
-	data->handle.callback_data = callback_data;
-	data->cancel_requested = FALSE;
-	data->uri = g_strdup (uri);
-
-	pthread_attr_init (&thread_attr);
-	pthread_attr_setdetachstate (&thread_attr, PTHREAD_CREATE_DETACHED);
-	if (pthread_create (&thread, &thread_attr, pthread_gnome_vfs_x_read_file_thread_entry, data) != 0) {
-		/* FIXME bugzilla.eazel.com 5071:
-		 * Would be cleaner to call through an idle callback here.
-		 */
-		(*callback) (GNOME_VFS_ERROR_INTERNAL, 0, NULL, NULL);
-		g_free (data);
-		return NULL;
-	}
-
-	return (GnomeVFSXReadFileHandle *)data;
-}
-
-static void
-pthread_gnome_vfs_x_read_file_async_cancel (GnomeVFSXReadFileHandle *handle)
-{
-	/* Must call this before the final callback kicks in. */
-	GnomeVFSXAsyncReadFileData *data;
-
-	data = (GnomeVFSXAsyncReadFileData *)handle;
-	data->cancel_requested = TRUE;
-	if (data->callback_result_ready_semaphore != NULL) {
-		pthread_mutex_unlock (data->callback_result_ready_semaphore);
-	}
-
-	/* now the thread will die on it's own and clean up after itself */
-}
-
-#endif
-
-/* Set up the read handle and start reading. */
-GnomeVFSXReadFileHandle *
-gnome_vfs_x_read_file_async (const char *uri,
-			     int priority,
-			     GnomeVFSXReadFileCallback callback,
-			     GnomeVFSXReadMoreCallback read_more_callback,
-			     gpointer callback_data)
-{
-#ifndef PTHREAD_ASYNC_READ
-	GnomeVFSXReadFileHandle *handle;
-
-	handle = g_new0 (GnomeVFSXReadFileHandle, 1);
-
-	handle->callback = callback;
-	handle->read_more_callback = read_more_callback;
-	handle->callback_data = callback_data;
-
-	gnome_vfs_async_open (&handle->handle,
-			      uri,
-			      GNOME_VFS_OPEN_READ,
-			      priority,
-			      read_file_open_callback,
-			      handle);
-	return handle;
-#else
-	return pthread_gnome_vfs_x_read_file_async(uri, callback, 
-		read_more_callback, callback_data);
-#endif
-}
-
-/* Set up the read handle and start reading. */
-GnomeVFSXReadFileHandle *
-gnome_vfs_x_read_entire_file_async (const char *uri,
-				    int priority,
-				    GnomeVFSXReadFileCallback callback,
-				    gpointer callback_data)
-{
-	return gnome_vfs_x_read_file_async (uri, priority, callback, NULL, callback_data);
-}
-
-/* Stop the presses! */
-void
-gnome_vfs_x_read_file_cancel (GnomeVFSXReadFileHandle *handle)
-{
-#ifndef PTHREAD_ASYNC_READ
-	gnome_vfs_async_cancel (handle->handle);
-	read_file_close (handle);
-	g_free (handle->buffer);
-	g_free (handle);
-#else
-
-	pthread_gnome_vfs_x_read_file_async_cancel (handle);
-#endif
-}
-
-gboolean
-gnome_vfs_x_uri_is_trash (const char *uri)
-{
-	return istr_has_prefix (uri, "trash:")
-		|| istr_has_prefix (uri, "gnome-trash:");
-}
-
-gboolean
-gnome_vfs_x_uri_is_trash_folder (const char *uri)
-{
-	GnomeVFSURI *vfs_uri, *trash_vfs_uri;
-	gboolean result;
-	
-	/* Use a check for the actual trash first so that the trash
-	 * itself will be "in trash". There are fancier ways to do
-	 * this, but lets start with this.
-	 */
- 	if (gnome_vfs_x_uri_is_trash (uri)) {
-		return TRUE;
-	}
-
-        vfs_uri = gnome_vfs_uri_new (uri);
-	if (vfs_uri == NULL) {
-		return FALSE;
-	}
-
-	result = gnome_vfs_find_directory
-		(vfs_uri, GNOME_VFS_DIRECTORY_KIND_TRASH,
-		 &trash_vfs_uri, FALSE, FALSE, 0777) == GNOME_VFS_OK;
-
-       if (result) {
-		result = gnome_vfs_uri_equal (trash_vfs_uri, vfs_uri);			
-		gnome_vfs_uri_unref (trash_vfs_uri);
-        }
-        
-        gnome_vfs_uri_unref (vfs_uri);
-
-	return result;
-}
-
-
-gboolean 
-gnome_vfs_x_uri_is_in_trash (const char *uri)
-{
-	GnomeVFSURI *vfs_uri, *trash_vfs_uri;
-	gboolean result;
-
-	/* Use a check for the actual trash first so that the trash
-	 * itself will be "in trash". There are fancier ways to do
-	 * this, but lets start with this.
-	 */
- 	if (gnome_vfs_x_uri_is_trash (uri)) {
-		return TRUE;
-	}
-
-        vfs_uri = gnome_vfs_uri_new (uri);
-	if (vfs_uri == NULL) {
-		return FALSE;
-	}
-
-	result = gnome_vfs_find_directory
-		(vfs_uri, GNOME_VFS_DIRECTORY_KIND_TRASH,
-		 &trash_vfs_uri, FALSE, FALSE, 0777) == GNOME_VFS_OK;
-
-       if (result) {
-		result = gnome_vfs_uri_equal (trash_vfs_uri, vfs_uri)
-			|| gnome_vfs_uri_is_parent (trash_vfs_uri, vfs_uri, TRUE);
-		gnome_vfs_uri_unref (trash_vfs_uri);
-        }
-
-        gnome_vfs_uri_unref (vfs_uri);
-
-	return result;
-}
-
-
-/**
- * gnome_vfs_x_format_uri_for_display:
- *
- * Filter, modify, unescape and change URIs to make them appropriate
- * to display to users.
- * 
- * Rules:
- * 	file: URI's without fragments should appear as local paths
- * 	file: URI's with fragments should appear as file: URI's
- * 	All other URI's appear as expected
- *
- * @uri: a URI
- *
- * returns a g_malloc'd string
- **/
-char *
-gnome_vfs_x_format_uri_for_display (const char *uri) 
-{
-	char *canonical_uri, *path;
-
-	g_return_val_if_fail (uri != NULL, g_strdup (""));
-
-	canonical_uri = gnome_vfs_x_make_uri_canonical (uri);
-
-	/* If there's no fragment and it's a local path. */
-	path = gnome_vfs_get_local_path_from_uri (canonical_uri);
-	if (path != NULL) {
-		g_free (canonical_uri);
-		return path;
-	}
-
-	g_free (path);
-	return canonical_uri;
-}
-
-static gboolean
-is_valid_scheme_character (char c)
-{
-	return g_ascii_isalnum (c) || c == '+' || c == '-' || c == '.';
-}
-
-static gboolean
-has_valid_scheme (const char *uri)
-{
-	const char *p;
-
-	p = uri;
-
-	if (!is_valid_scheme_character (*p)) {
-		return FALSE;
-	}
-
-	do {
-		p++;
-	} while (is_valid_scheme_character (*p));
-
-	return *p == ':';
-}
-
-/**
- * gnome_vfs_x_make_uri_from_input:
- *
- * Takes a user input path/URI and makes a valid URI
- * out of it
- *
- * @location: a possibly mangled "uri"
- *
- * returns a newly allocated uri
- *
- **/
-char *
-gnome_vfs_x_make_uri_from_input (const char *location)
-{
-	char *stripped, *path, *uri;
-
-	g_return_val_if_fail (location != NULL, g_strdup (""));
-
-	/* Strip off leading and trailing spaces.
-	 * This makes copy/paste of URIs less error-prone.
-	 */
-	stripped = g_strstrip (g_strdup (location));
-
-	switch (stripped[0]) {
-	case '\0':
-		uri = g_strdup ("");
-		break;
-	case '/':
-		uri = gnome_vfs_get_uri_from_local_path (stripped);
-		break;
-	case '~':
-		path = gnome_vfs_expand_initial_tilde (stripped);
-                /* deliberately falling into default case on fail */
-		if (*path == '/') {
-			uri = gnome_vfs_get_uri_from_local_path (path);
-			g_free (path);
-			break;
-		}
-                g_free (path);
-                /* don't insert break here, read above comment */
-	default:
-		if (has_valid_scheme (stripped)) {
-			uri = g_strdup (stripped);
-		} else {
-			uri = g_strconcat ("http://", stripped, NULL);
-		}
-	}
-
-	g_free (stripped);
-
-	return uri;
-}
-
-/* Note that NULL's and full paths are also handled by this function.
- * A NULL location will return the current working directory
- */
-static char *
-file_uri_from_local_relative_path (const char *location)
-{
-	char *current_dir;
-	char *base_uri, *base_uri_slash;
-	char *location_escaped;
-	char *uri;
-
-	current_dir = g_get_current_dir ();
-	base_uri = gnome_vfs_get_uri_from_local_path (current_dir);
-	/* g_get_current_dir returns w/o trailing / */
-	base_uri_slash = g_strconcat (base_uri, "/", NULL);
-
-	location_escaped = gnome_vfs_escape_path_string (location);
-
-	uri = gnome_vfs_uri_make_full_from_relative (base_uri_slash, location_escaped);
-
-	g_free (location_escaped);
-	g_free (base_uri_slash);
-	g_free (base_uri);
-	g_free (current_dir);
-
-	return uri;
-}
-
-/**
- * gnome_vfs_x_make_uri_from_shell_arg:
- *
- * Similar to gnome_vfs_x_make_uri_from_input, except that:
- * 
- * 1) guesses relative paths instead of http domains
- * 2) doesn't bother stripping leading/trailing white space
- * 3) doesn't bother with ~ expansion--that's done by the shell
- *
- * @location: a possibly mangled "uri"
- *
- * returns a newly allocated uri
- *
- **/
-char *
-gnome_vfs_x_make_uri_from_shell_arg (const char *location)
-{
-	char *uri;
-
-	g_return_val_if_fail (location != NULL, g_strdup (""));
-
-	switch (location[0]) {
-	case '\0':
-		uri = g_strdup ("");
-		break;
-	case '/':
-		uri = gnome_vfs_get_uri_from_local_path (location);
-		break;
-	default:
-		if (has_valid_scheme (location)) {
-			uri = g_strdup (location);
-		} else {
-			uri = file_uri_from_local_relative_path (location);
-		}
-	}
-
-	return uri;
-}
-
-char *
-gnome_vfs_x_uri_get_basename (const char *uri)
-{
-	GnomeVFSURI *vfs_uri;
-	char *name;
-
-	/* Make VFS version of URI. */
-	vfs_uri = gnome_vfs_uri_new (uri);
-	if (vfs_uri == NULL) {
-		return NULL;
-	}
-
-	/* Extract name part. */
-	name = gnome_vfs_uri_extract_short_name (vfs_uri);
-	gnome_vfs_uri_unref (vfs_uri);
-
-	return name;
-}
-
-char *
-gnome_vfs_x_uri_get_dirname (const char *uri)
-{
-	GnomeVFSURI *vfs_uri;
-	char *name;
-
-	/* Make VFS version of URI. */
-	vfs_uri = gnome_vfs_uri_new (uri);
-	if (vfs_uri == NULL) {
-		return NULL;
-	}
-
-	/* Extract name part. */
-	name = gnome_vfs_uri_extract_dirname (vfs_uri);
-	gnome_vfs_uri_unref (vfs_uri);
-
-	return name;
-}
-
-
-char *
-gnome_vfs_x_uri_get_scheme (const char *uri)
-{
-	char *colon;
-
-	g_return_val_if_fail (uri != NULL, NULL);
-
-	colon = strchr (uri, ':');
-	
-	if (colon == NULL) {
-		return NULL;
-	}
-	
-	return g_strndup (uri, colon - uri);
-}
-
-static gboolean
-gnome_vfs_x_uri_is_local_scheme (const char *uri)
-{
-	gboolean is_local_scheme;
-	char *temp_scheme;
-	int i;
-	char *local_schemes[] = {"file:", "help:", "ghelp:", "gnome-help:",
-				 "trash:", "man:", "info:", 
-				 "hardware:", "search:", "pipe:",
-				 "gnome-trash:", NULL};
-
-	is_local_scheme = FALSE;
-	for (temp_scheme = *local_schemes, i = 0; temp_scheme != NULL; i++, temp_scheme = local_schemes[i]) {
-		is_local_scheme = istr_has_prefix (uri, temp_scheme);
-		if (is_local_scheme) {
-			break;
-		}
-	}
-	
-
-	return is_local_scheme;
-}
-
-static char *
-gnome_vfs_x_handle_trailing_slashes (const char *uri)
-{
-	char *temp, *uri_copy;
-	gboolean previous_char_is_column, previous_chars_are_slashes_without_column;
-	gboolean previous_chars_are_slashes_with_column;
-	gboolean is_local_scheme;
-
-	g_assert (uri != NULL);
-
-	uri_copy = g_strdup (uri);
-	if (strlen (uri_copy) <= 2) {
-		return uri_copy;
-	}
-
-	is_local_scheme = gnome_vfs_x_uri_is_local_scheme (uri);
-
-	previous_char_is_column = FALSE;
-	previous_chars_are_slashes_without_column = FALSE;
-	previous_chars_are_slashes_with_column = FALSE;
-
-	/* remove multiple trailing slashes */
-	for (temp = uri_copy; *temp != '\0'; temp++) {
-		if (*temp == '/' && !previous_char_is_column) {
-			previous_chars_are_slashes_without_column = TRUE;
-		} else if (*temp == '/' && previous_char_is_column) {
-			previous_chars_are_slashes_without_column = FALSE;
-			previous_char_is_column = TRUE;
-			previous_chars_are_slashes_with_column = TRUE;
-		} else {
-			previous_chars_are_slashes_without_column = FALSE;
-			previous_char_is_column = FALSE;
-			previous_chars_are_slashes_with_column = FALSE;
-		}
-
-		if (*temp == ':') {
-			previous_char_is_column = TRUE;
-		}
-	}
-
-	if (*temp == '\0' && previous_chars_are_slashes_without_column) {
-		if (is_local_scheme) {
-			/* go back till you remove them all. */
-			for (temp--; *(temp) == '/'; temp--) {
-				*temp = '\0';
-			}
-		} else {
-			/* go back till you remove them all but one. */
-			for (temp--; *(temp - 1) == '/'; temp--) {
-				*temp = '\0';
-			}			
-		}
-	}
-
-	if (*temp == '\0' && previous_chars_are_slashes_with_column) {
-		/* go back till you remove them all but three. */
-		for (temp--; *(temp - 3) != ':' && *(temp - 2) != ':' && *(temp - 1) != ':'; temp--) {
-			*temp = '\0';
-		}
-	}
-
-
-	return uri_copy;
-}
-
-char *
-gnome_vfs_x_make_uri_canonical (const char *uri)
-{
-	char *canonical_uri, *old_uri, *p;
-	gboolean relative_uri;
-
-	relative_uri = FALSE;
-
-	if (uri == NULL) {
-		return NULL;
-	}
-
-	/* Convert "gnome-trash:<anything>" and "trash:<anything>" to
-	 * "trash:".
-	 */
-	if (gnome_vfs_x_uri_is_trash (uri)) {
-		return g_strdup (GNOME_VFS_X_TRASH_URI);
-	}
-
-	/* FIXME bugzilla.eazel.com 648: 
-	 * This currently ignores the issue of two uris that are not identical but point
-	 * to the same data except for the specific cases of trailing '/' characters,
-	 * file:/ and file:///, and "lack of file:".
-	 */
-
-	canonical_uri = gnome_vfs_x_handle_trailing_slashes (uri);
-
-	/* Note: In some cases, a trailing slash means nothing, and can
-	 * be considered equivalent to no trailing slash. But this is
-	 * not true in every case; specifically not for web addresses passed
-	 * to a web-browser. So we don't have the trailing-slash-equivalence
-	 * logic here, but we do use that logic in GnomeVFSXDirectory where
-	 * the rules are more strict.
-	 */
-
-	/* Add file: if there is no scheme. */
-	if (strchr (canonical_uri, ':') == NULL) {
-		old_uri = canonical_uri;
-
-		if (old_uri[0] != '/') {
-			/* FIXME bugzilla.eazel.com 5069: 
-			 *  bandaid alert. Is this really the right thing to do?
-			 * 
-			 * We got what really is a relative path. We do a little bit of
-			 * a stretch here and assume it was meant to be a cryptic absolute path,
-			 * and convert it to one. Since we can't call gnome_vfs_uri_new and
-			 * gnome_vfs_uri_to_string to do the right make-canonical conversion,
-			 * we have to do it ourselves.
-			 */
-			relative_uri = TRUE;
-			canonical_uri = gnome_vfs_make_path_name_canonical (old_uri);
-			g_free (old_uri);
-			old_uri = canonical_uri;
-			canonical_uri = g_strconcat ("file:///", old_uri, NULL);
-		} else {
-			canonical_uri = g_strconcat ("file:", old_uri, NULL);
-		}
-		g_free (old_uri);
-	}
-
-	/* Lower-case the scheme. */
-	for (p = canonical_uri; *p != ':'; p++) {
-		g_assert (*p != '\0');
-		*p = g_ascii_tolower (*p);
-	}
-
-	if (!relative_uri) {
-		old_uri = canonical_uri;
-		canonical_uri = gnome_vfs_make_uri_canonical (canonical_uri);
-		if (canonical_uri != NULL) {
-			g_free (old_uri);
-		} else {
-			canonical_uri = old_uri;
-		}
-	}
-	
-	/* FIXME bugzilla.eazel.com 2802:
-	 * Work around gnome-vfs's desire to convert file:foo into file://foo
-	 * by converting to file:///foo here. When you remove this, check that
-	 * typing "foo" into location bar does not crash and returns an error
-	 * rather than displaying the contents of /
-	 */
-	if (str_has_prefix (canonical_uri, "file://")
-	    && !str_has_prefix (canonical_uri, "file:///")) {
-		old_uri = canonical_uri;
-		canonical_uri = g_strconcat ("file:/", old_uri + 5, NULL);
-		g_free (old_uri);
-	}
-
-	return canonical_uri;
-}
-
-char *
-gnome_vfs_x_make_uri_canonical_strip_fragment (const char *uri)
-{
-	const char *fragment;
-	char *without_fragment, *canonical;
-
-	fragment = strchr (uri, '#');
-	if (fragment == NULL) {
-		return gnome_vfs_x_make_uri_canonical (uri);
-	}
-
-	without_fragment = g_strndup (uri, fragment - uri);
-	canonical = gnome_vfs_x_make_uri_canonical (without_fragment);
-	g_free (without_fragment);
-	return canonical;
-}
-
-char *
-gnome_vfs_x_make_uri_from_half_baked_uri (const char *half_baked_uri)
-{
-	/* A "half-baked URI" is a path with a file prefix in front of
-	 * it. There are some interfaces where these are the norm,
-	 * even though they are not correct URIs. This kind of URI is
-	 * what gmc used to make, so it's the defacto standard for
-	 * drag and drop.
-	 */
-	if (istr_has_prefix (half_baked_uri, "file:/")
-	    && !istr_has_prefix (half_baked_uri, "file://")) {
-		return gnome_vfs_get_uri_from_local_path (half_baked_uri + strlen ("file:"));
-	}
-	
-	return gnome_vfs_x_make_uri_canonical (half_baked_uri);
-}
-
-static gboolean
-uris_match (const char *uri_1, const char *uri_2, gboolean ignore_fragments)
-{
-	char *canonical_1, *canonical_2;
-	gboolean result;
-
-	if (ignore_fragments) {
-		canonical_1 = gnome_vfs_x_make_uri_canonical_strip_fragment (uri_1);
-		canonical_2 = gnome_vfs_x_make_uri_canonical_strip_fragment (uri_2);
-	} else {
-		canonical_1 = gnome_vfs_x_make_uri_canonical (uri_1);
-		canonical_2 = gnome_vfs_x_make_uri_canonical (uri_2);
-	}
-
-	result = str_is_equal (canonical_1, canonical_2);
-
-	g_free (canonical_1);
-	g_free (canonical_2);
-	
-	return result;
-}
-
-gboolean
-gnome_vfs_x_uris_match (const char *uri_1, const char *uri_2)
-{
-	return uris_match (uri_1, uri_2, FALSE);
-}
-
-gboolean
-gnome_vfs_x_uris_match_ignore_fragments (const char *uri_1, const char *uri_2)
-{
-	return uris_match (uri_1, uri_2, TRUE);
-}
-
-/* convenience routine to use gnome-vfs to test if a string is a remote uri */
-gboolean
-gnome_vfs_x_is_remote_uri (const char *uri)
-{
-	gboolean is_local;
-	GnomeVFSURI *vfs_uri;
-	
-	vfs_uri = gnome_vfs_uri_new (uri);
-	is_local = gnome_vfs_uri_is_local (vfs_uri);
-	gnome_vfs_uri_unref(vfs_uri);
-	return !is_local;
-}
-
-
-GnomeVFSResult
-gnome_vfs_x_make_directory_and_parents (GnomeVFSURI *uri, guint permissions)
-{
-	GnomeVFSResult result;
-	GnomeVFSURI *parent_uri;
-
-	/* Make the directory, and return right away unless there's
-	   a possible problem with the parent.
-	*/
-	result = gnome_vfs_make_directory_for_uri (uri, permissions);
-	if (result != GNOME_VFS_ERROR_NOT_FOUND) {
-		return result;
-	}
-
-	/* If we can't get a parent, we are done. */
-	parent_uri = gnome_vfs_uri_get_parent (uri);
-	if (parent_uri == NULL) {
-		return result;
-	}
-
-	/* If we can get a parent, use a recursive call to create
-	   the parent and its parents.
-	*/
-	result = gnome_vfs_x_make_directory_and_parents (parent_uri, permissions);
-	gnome_vfs_uri_unref (parent_uri);
-	if (result != GNOME_VFS_OK) {
-		return result;
-	}
-
-	/* A second try at making the directory after the parents
-	   have all been created.
-	*/
-	result = gnome_vfs_make_directory_for_uri (uri, permissions);
-	return result;
-}
-
-GnomeVFSResult
-gnome_vfs_x_copy_uri_simple ( const char *source_uri, const char *dest_uri)
-{
-	GnomeVFSResult result;
-	GnomeVFSURI *real_source_uri, *real_dest_uri;
-	real_source_uri = gnome_vfs_uri_new (source_uri);
-	real_dest_uri = gnome_vfs_uri_new (dest_uri);
-		
-	result = gnome_vfs_xfer_uri (real_source_uri, real_dest_uri,
-					GNOME_VFS_XFER_RECURSIVE, GNOME_VFS_XFER_ERROR_MODE_ABORT,
-					GNOME_VFS_XFER_OVERWRITE_MODE_REPLACE,
-					NULL, NULL);
-		
-	gnome_vfs_uri_unref (real_source_uri);
-	gnome_vfs_uri_unref (real_dest_uri);
-		
-	return  result;
-}
-
-/*#if !defined (EEL_OMIT_SELF_CHECK)*/
-/*
-  void
-  eel_self_check_vfs_extensions (void)
-  {
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input (""), "");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input (" "), "");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input (" / "), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input (" /"), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input (" /home\n\n"), "file:///home");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input (" \n\t"), "");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("!"), "http://!");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("#"), "http://#");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("/ "), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("/!"), "file:///!");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("/#"), "file:///%23");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("/%20"), "file:///%2520");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("/%25"), "file:///%2525");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("/:"), "file:///%3A");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("/home"), "file:///home");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("/home/darin"), "file:///home/darin");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input (":"), "http://:");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("::"), "http://::");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input (":://:://:::::::::::::::::"), "http://:://:://:::::::::::::::::");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("file:"), "file:");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("file:///%20"), "file:///%20");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("file:///%3F"), "file:///%3F");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("file:///:"), "file:///:");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("file:///?"), "file:///?");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("file:///home/joe/some file"), "file:///home/joe/some file");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("file://home/joe/some file"), "file://home/joe/some file");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("file:::::////"), "file:::::////");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("foo://foobar.txt"), "foo://foobar.txt");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("home"), "http://home");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("http://null.stanford.edu"), "http://null.stanford.edu");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("http://null.stanford.edu:80"), "http://null.stanford.edu:80");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("http://seth@null.stanford.edu:80"), "http://seth@null.stanford.edu:80");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("http:::::::::"), "http:::::::::");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("www.eazel.com"), "http://www.eazel.com");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_input ("http://null.stanford.edu/some file"), "http://null.stanford.edu/some file");
-
-  EEL_CHECK_STRING_RESULT (eel_uri_get_scheme ("file:///var/tmp"), "file");
-  EEL_CHECK_STRING_RESULT (eel_uri_get_scheme (""), NULL);
-  EEL_CHECK_STRING_RESULT (eel_uri_get_scheme ("file:///var/tmp::"), "file");
-  EEL_CHECK_STRING_RESULT (eel_uri_get_scheme ("man:ls"), "man");
-  EEL_CHECK_BOOLEAN_RESULT (eel_uri_is_local_scheme ("file:///var/tmp"), TRUE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uri_is_local_scheme ("http://www.yahoo.com"), FALSE);
-
-  EEL_CHECK_STRING_RESULT (eel_handle_trailing_slashes ("file:///////"), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_handle_trailing_slashes ("file://foo/"), "file://foo");
-  EEL_CHECK_STRING_RESULT (eel_handle_trailing_slashes ("file://foo"), "file://foo");
-  EEL_CHECK_STRING_RESULT (eel_handle_trailing_slashes ("file://"), "file://");
-  EEL_CHECK_STRING_RESULT (eel_handle_trailing_slashes ("file:/"), "file:/");
-  EEL_CHECK_STRING_RESULT (eel_handle_trailing_slashes ("http://le-hacker.org"), "http://le-hacker.org");
-  EEL_CHECK_STRING_RESULT (eel_handle_trailing_slashes ("http://le-hacker.org/dir//////"), "http://le-hacker.org/dir/");
-  EEL_CHECK_STRING_RESULT (eel_handle_trailing_slashes ("http://le-hacker.org/////"), "http://le-hacker.org/");
-*/
-/* eel_make_uri_canonical */
-
-/* FIXME bugzilla.eazel.com 5072: this is a bizarre result from an empty string */
-/*
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical (""), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_half_baked_uri (""), "file:///");
-
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("file:/"), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("file:///"), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("file:///home/mathieu/"), "file:///home/mathieu");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("file:///home/mathieu"), "file:///home/mathieu");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("ftp://mathieu:password@le-hackeur.org"), "ftp://mathieu:password@le-hackeur.org");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("ftp://mathieu:password@le-hackeur.org/"), "ftp://mathieu:password@le-hackeur.org/");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("http://le-hackeur.org"), "http://le-hackeur.org");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("http://le-hackeur.org/"), "http://le-hackeur.org/");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("http://le-hackeur.org/dir"), "http://le-hackeur.org/dir");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("http://le-hackeur.org/dir/"), "http://le-hackeur.org/dir/");
-*/
-/* FIXME bugzilla.eazel.com 5068: the "nested" URI loses some characters here. Maybe that's OK because we escape them in practice? */
-/*
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("search://[file://]file_name contains stuff"), "search://[file/]file_name contains stuff");
-
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("eazel-services:/~turtle"), "eazel-services:///~turtle");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("eazel-services:///~turtle"), "eazel-services:///~turtle");
-
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("/"), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("/."), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("/./."), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("/.//."), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("/.///."), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("a"), "file:///a");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("/a/b/.."), "file:///a");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("a///"), "file:///a/");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("./a"), "file:///a");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("../a"), "file:///../a");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("..//a"), "file:///../a");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("a/."), "file:///a");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("/a/."), "file:///a");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("/a/.."), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("a//."), "file:///a");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("./a/."), "file:///a");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical (".//a/."), "file:///a");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("./a//."), "file:///a");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("a/.."), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("a//.."), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("./a/.."), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical (".//a/.."), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("./a//.."), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical (".//a//.."), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("a/b/.."), "file:///a");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("./a/b/.."), "file:///a");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("/./a/b/.."), "file:///a");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("/a/./b/.."), "file:///a");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("/a/b/./.."), "file:///a");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("/a/b/../."), "file:///a");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("a/b/../.."), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("./a/b/../.."), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("././a/b/../.."), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("a/b/c/../.."), "file:///a");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("a/b/c/../../d"), "file:///a/d");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("a/b/../../d"), "file:///d");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("a/../../d"), "file:///../d");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("a/b/.././.././c"), "file:///c");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("a/.././.././b/c"), "file:///../b/c");
-
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("http://www.eazel.com"), "http://www.eazel.com");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("http://www.eazel.com/"), "http://www.eazel.com/");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("http://www.eazel.com/dir"), "http://www.eazel.com/dir");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("http://www.eazel.com/dir/"), "http://www.eazel.com/dir/");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("http://yakk:womble@www.eazel.com:42/blah/"), "http://yakk:womble@www.eazel.com:42/blah/");
-
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("FILE:///"), "file:///");
-
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("file:///trash"), "file:///trash");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("file:///Users/mikef"), "file:///Users/mikef");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("/trash"), "file:///trash");
-
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("root"), "file:///root");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("/root"), "file:///root");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("//root"), "file:///root");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("///root"), "file:///root");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("////root"), "file:///root");
-*/
-/* Test cases related to escaping. */
-/*
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("file:///%3F"), "file:///%3F");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("file:///%78"), "file:///x");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("file:///?"), "file:///%3F");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("file:///x"), "file:///x");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("glorb:///%3F"), "glorb:///%3F");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("glorb:///%78"), "glorb:///x");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("glorb:///?"), "glorb:///%3F");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("glorb:///x"), "glorb:///x");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("http:///%3F"), "http:///%3F");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("http:///%78"), "http:///x");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("http:///?"), "http:///?");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("http:///x"), "http:///x");
-
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("http://www.Eazel.Com"), "http://www.eazel.com");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("http://www.Eazel.Com/xXx"), "http://www.eazel.com/xXx");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("ftp://Darin@www.Eazel.Com/xXx"), "ftp://Darin@www.eazel.com/xXx");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("http://www.Eazel.Com:80/xXx"), "http://www.eazel.com:80/xXx");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("ftp://Darin@www.Eazel.Com:80/xXx"), "ftp://Darin@www.eazel.com:80/xXx");
-*/
-/* FIXME bugzilla.eazel.com 4101: Why append a slash in this case, but not in the http://www.eazel.com case? */
-/*
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("http://www.eazel.com:80"), "http://www.eazel.com:80/");
-*/
-/* Note: these cases behave differently here than in
- * gnome-vfs. In some cases because of bugs in gnome-vfs, but
- * in other cases because we just want them handled
- * differently.
- */
-/*
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("file:trash"), "file:trash");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("//trash"), "file:///trash");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("file:"), "file:");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("trash"), "file:///trash");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("glorp:"), "glorp:");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("TRASH:XXX"), EEL_TRASH_URI);
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("trash:xxx"), EEL_TRASH_URI);
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("GNOME-TRASH:XXX"), EEL_TRASH_URI);
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("gnome-trash:xxx"), EEL_TRASH_URI);
-
-  EEL_CHECK_STRING_RESULT (eel_make_uri_canonical ("pipe:gnome-info2html2 as"), "pipe:gnome-info2html2 as");
-	
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_half_baked_uri ("file:/"), "file:///");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_half_baked_uri ("file:/ "), "file:///%20");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_half_baked_uri ("file:/%"), "file:///%25");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_half_baked_uri ("file:///%3F"), "file:///%3F");
-  EEL_CHECK_STRING_RESULT (eel_make_uri_from_half_baked_uri ("file:/%3F"), "file:///%253F");
-
-  EEL_CHECK_STRING_RESULT (eel_uri_make_full_from_relative (NULL, NULL), NULL);
-  EEL_CHECK_STRING_RESULT (eel_uri_make_full_from_relative ("http://a/b/c/d;p?q", NULL), "http://a/b/c/d;p?q");
-  EEL_CHECK_STRING_RESULT (eel_uri_make_full_from_relative (NULL, "http://a/b/c/d;p?q"), "http://a/b/c/d;p?q");
-*/
-/* These test cases are from RFC 2396. */
-/*
-  #define TEST_PARTIAL(partial, result) \
-  EEL_CHECK_STRING_RESULT (eel_uri_make_full_from_relative \
-  ("http://a/b/c/d;p?q", partial), result)
-
-  TEST_PARTIAL ("g", "http://a/b/c/g");
-  TEST_PARTIAL ("./g", "http://a/b/c/g");
-  TEST_PARTIAL ("g/", "http://a/b/c/g/");
-  TEST_PARTIAL ("/g", "http://a/g");
-
-  TEST_PARTIAL ("//g", "http://g");
-	
-  TEST_PARTIAL ("?y", "http://a/b/c/?y");
-  TEST_PARTIAL ("g?y", "http://a/b/c/g?y");
-  TEST_PARTIAL ("#s", "http://a/b/c/d;p#s");
-  TEST_PARTIAL ("g#s", "http://a/b/c/g#s");
-  TEST_PARTIAL ("g?y#s", "http://a/b/c/g?y#s");
-  TEST_PARTIAL (";x", "http://a/b/c/;x");
-  TEST_PARTIAL ("g;x", "http://a/b/c/g;x");
-  TEST_PARTIAL ("g;x?y#s", "http://a/b/c/g;x?y#s");
-
-  TEST_PARTIAL (".", "http://a/b/c/");
-  TEST_PARTIAL ("./", "http://a/b/c/");
-
-  TEST_PARTIAL ("..", "http://a/b/");
-  TEST_PARTIAL ("../g", "http://a/b/g");
-  TEST_PARTIAL ("../..", "http://a/");
-  TEST_PARTIAL ("../../", "http://a/");
-  TEST_PARTIAL ("../../g", "http://a/g");
-*/
-/* Others */
-/*
-  TEST_PARTIAL ("g/..", "http://a/b/c/");
-  TEST_PARTIAL ("g/../", "http://a/b/c/");
-  TEST_PARTIAL ("g/../g", "http://a/b/c/g");
-
-  #undef TEST_PARTIAL
-
-  EEL_CHECK_STRING_RESULT (eel_format_uri_for_display (""), "/");
-  EEL_CHECK_STRING_RESULT (eel_format_uri_for_display (":"), ":");
-  EEL_CHECK_STRING_RESULT (eel_format_uri_for_display ("file:///h/user"), "/h/user");
-  EEL_CHECK_STRING_RESULT (eel_format_uri_for_display ("file:///%68/user/foo%2ehtml"), "/h/user/foo.html");
-  EEL_CHECK_STRING_RESULT (eel_format_uri_for_display ("file:///h/user/foo.html#fragment"), "file:///h/user/foo.html#fragment");
-  EEL_CHECK_STRING_RESULT (eel_format_uri_for_display ("http://www.eazel.com"), "http://www.eazel.com");
-  EEL_CHECK_STRING_RESULT (eel_format_uri_for_display ("http://www.eazel.com/jobs#Engineering"), "http://www.eazel.com/jobs#Engineering");
-  EEL_CHECK_STRING_RESULT (eel_format_uri_for_display ("file"), "/file");
-  EEL_CHECK_STRING_RESULT (eel_format_uri_for_display ("file:///#"), "file:///#");
-  EEL_CHECK_STRING_RESULT (eel_format_uri_for_display ("file:///"), "/");
-  EEL_CHECK_STRING_RESULT (eel_format_uri_for_display ("file:///%20%23"), "/ #");
-  EEL_CHECK_STRING_RESULT (eel_format_uri_for_display ("file:///%20%23#"), "file:///%20%23#");
-
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match ("", ""), TRUE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match (":", ":"), TRUE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match ("file:///h/user/file#gunzip:///", "file:///h/user/file#gunzip:///"), TRUE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match ("file:///h/user/file#gunzip:///", "file:///h/user/file#gzip:///"), FALSE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match ("http://www.Eazel.Com", "http://www.eazel.com"), TRUE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match ("http://www.Eazel.Com:80", "http://www.eazel.com:80"), TRUE);
-
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match_ignore_fragments ("", ""), TRUE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match_ignore_fragments (":", ":"), TRUE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match_ignore_fragments ("file:///h/user/file#gunzip:///", "file:///h/user/file#gunzip:///"), TRUE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match_ignore_fragments ("file:///h/user/file#gunzip:///", "file:///h/user/file#gzip:///"), TRUE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match_ignore_fragments ("http://www.Eazel.Com", "http://www.eazel.com"), TRUE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match_ignore_fragments ("http://www.Eazel.Com:80", "http://www.eazel.com:80"), TRUE);
-
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match_ignore_fragments ("file:///h/user", "file:///h/user"), TRUE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match_ignore_fragments ("file:///h/user#frag", "file:///h/user"), TRUE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match_ignore_fragments ("file:///h/user#frag", "file:///h/user/"), TRUE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match_ignore_fragments ("file:///h/user#frag", "file:///h/user%23frag"), FALSE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match_ignore_fragments ("file:///h/user/", "file:///h/user"), TRUE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match_ignore_fragments ("file:///h/user/", "http:///h/user"), FALSE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match_ignore_fragments ("file:///h/user/", "http://www.eazel.com"), FALSE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match_ignore_fragments ("file:///h/user/file#gunzip:///", "file:///h/user/file"), TRUE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match_ignore_fragments ("file:///h/user/file#gunzip:///", "file:///h/user/file"), TRUE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match_ignore_fragments ("file:///h/user/file.html.gz#gunzip:///#fragment", "file:///h/user/file.html.gz"), TRUE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match_ignore_fragments ("file:///h/user/#frag", "file:///h/user/"), TRUE);
-*/
-/* Since it's illegal to have a # in a scheme name, it doesn't really matter what these cases do */
-/*
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match_ignore_fragments ("fi#le:///h/user/file", "fi"), TRUE);
-  EEL_CHECK_BOOLEAN_RESULT (eel_uris_match_ignore_fragments ("fi#le:///h/user/file", "fi#le:"), TRUE);
-
-}
-
-#endif *//* !EEL_OMIT_SELF_CHECK */
diff --git a/src/gnome-vfs-helpers.h b/src/gnome-vfs-helpers.h
deleted file mode 100644
index 4d72e85..0000000
--- a/src/gnome-vfs-helpers.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* eel-vfs-extensions.h - gnome-vfs extensions.  Its likely some of these will 
-                          be part of gnome-vfs in the future.
-
-   Copyright (C) 1999, 2000 Eazel, Inc.
-
-   The Gnome Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   The Gnome Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the Gnome Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.
-
-   Authors: Darin Adler <darin@eazel.com>
-	    Pavel Cisler <pavel@eazel.com>
-	    Mike Fleming  <mfleming@eazel.com>
-            John Sullivan <sullivan@eazel.com>
-	    Seth Nickell <snickell@stanford.edu>
-*/
-
-#ifndef GNOME_VFS_HELPERS_H
-#define GNOME_VFS_HELPERS_H
-
-#include <libgnomevfs/gnome-vfs-file-size.h>
-#include <libgnomevfs/gnome-vfs-result.h>
-#include <libgnomevfs/gnome-vfs-uri.h>
-
-G_BEGIN_DECLS
-
-#define	GNOME_VFS_X_TRASH_URI "trash:"
-
-typedef void     (* GnomeVFSXReadFileCallback) (GnomeVFSResult result,
-					  GnomeVFSFileSize file_size,
-					  char *file_contents,
-					  gpointer callback_data);
-typedef gboolean (* GnomeVFSXReadMoreCallback) (GnomeVFSFileSize file_size,
-					  const char *file_contents,
-					  gpointer callback_data);
-
-typedef struct GnomeVFSXReadFileHandle GnomeVFSXReadFileHandle;
-
-/* Read an entire file at once with gnome-vfs. */
-GnomeVFSResult     gnome_vfs_x_read_entire_file                  (const char           *uri,
-							  int                  *file_size,
-							  char                **file_contents);
-GnomeVFSXReadFileHandle *gnome_vfs_x_read_entire_file_async            (const char           *uri,
-							  int                         priority,
-							  GnomeVFSXReadFileCallback   callback,
-							  gpointer              callback_data);
-GnomeVFSXReadFileHandle *gnome_vfs_x_read_file_async                   (const char           *uri,
-							  int                         priority,
-							  GnomeVFSXReadFileCallback   callback,
-							  GnomeVFSXReadMoreCallback   read_more_callback,
-							  gpointer              callback_data);
-void               gnome_vfs_x_read_file_cancel                  (GnomeVFSXReadFileHandle    *handle);
-
-gboolean           gnome_vfs_x_uri_is_trash                      (const char           *uri);
-gboolean           gnome_vfs_x_uri_is_trash_folder               (const char           *uri);
-gboolean           gnome_vfs_x_uri_is_in_trash                   (const char           *uri);
-
-char *             gnome_vfs_x_format_uri_for_display            (const char           *uri);
-char *             gnome_vfs_x_make_uri_from_input               (const char           *location);
-char *             gnome_vfs_x_make_uri_from_shell_arg           (const char           *location);
-char *             gnome_vfs_x_make_uri_canonical                (const char           *uri);
-char *             gnome_vfs_x_make_uri_canonical_strip_fragment (const char           *uri);
-char *             gnome_vfs_x_make_uri_from_half_baked_uri      (const char           *half_baked_uri);
-gboolean           gnome_vfs_x_uris_match                        (const char           *uri_1,
-							  const char           *uri_2);
-gboolean           gnome_vfs_x_uris_match_ignore_fragments       (const char           *uri_1,
-							  const char           *uri_2);
-char *             gnome_vfs_x_uri_get_basename                  (const char           *uri);
-char *		   gnome_vfs_x_uri_get_dirname 			 (const char *uri);
-
-char *             gnome_vfs_x_uri_get_scheme                    (const char           *uri);
-char *             gnome_vfs_x_uri_make_full_from_relative       (const char           *base_uri,
-							  const char           *uri);
-
-/* Convenience routine for simple file copying using text-based uris */
-GnomeVFSResult     gnome_vfs_x_copy_uri_simple                   (const char           *source_uri,
-							  const char           *dest_uri);
-
-/* gnome-vfs cover to make a directory and parents */
-GnomeVFSResult     gnome_vfs_x_make_directory_and_parents        (GnomeVFSURI          *uri,
-							  guint                 permissions);
-
-/* Convenience routine to test if a string is a remote URI. */
-gboolean           gnome_vfs_x_is_remote_uri                     (const char           *uri);
-
-G_END_DECLS
-
-#endif /* GNOME_VFS_HELPERS_H */

commit 44f365b125668352f288ead78436f8effe680512
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Fri Feb 29 00:28:14 2008 +0100

    Use ..._for_path in src/main.c for shell argument.

diff --git a/src/main.c b/src/main.c
index 0b93247..0428c85 100644
--- a/src/main.c
+++ b/src/main.c
@@ -591,7 +591,7 @@ prepare_app (void)
 			locale_archive = g_filename_from_utf8 (utf8_archive, -1, NULL, NULL, NULL);
 			if (locale_archive == NULL)
 				locale_archive = g_strdup (utf8_archive);
-			file = g_file_new_for_uri (locale_archive);
+			file = g_file_new_for_path (locale_archive);
 			uri = g_file_get_uri (file);
 			g_object_unref (file);
 			g_free (locale_archive);

commit fb6945d9a40b3bacc6f745ec1688c912aff3200d
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Fri Feb 29 00:25:06 2008 +0100

    Switch src/main.c to gio.

diff --git a/src/main.c b/src/main.c
index 5eb08e9..0b93247 100644
--- a/src/main.c
+++ b/src/main.c
@@ -25,8 +25,7 @@
 
 #include <libgnome/gnome-config.h>
 #include <libgnomeui/libgnomeui.h>
-#include <libgnomevfs/gnome-vfs-init.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
+#include <gio/gio.h>
 #include <glade/glade.h>
 #include "file-utils.h"
 #include "glib-utils.h"
@@ -228,11 +227,6 @@ main (int argc, char **argv)
 	gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
 					   PKG_DATA_DIR G_DIR_SEPARATOR_S "icons");
 
-/*
-	if (! gnome_vfs_init ())
-		g_error ("Cannot initialize the Virtual File System.");
-*/
-
 	gnome_authentication_manager_init ();
 	glade_init ();
 	fr_stock_init ();
@@ -588,6 +582,7 @@ prepare_app (void)
 		int i = 0;
 		while ((utf8_archive = remaining_args[i++]) != NULL) {
 			GtkWidget *window;
+			GFile     *file;
 			char      *uri;
 			
 			window = fr_window_new ();
@@ -596,7 +591,9 @@ prepare_app (void)
 			locale_archive = g_filename_from_utf8 (utf8_archive, -1, NULL, NULL, NULL);
 			if (locale_archive == NULL)
 				locale_archive = g_strdup (utf8_archive);
-			uri = gnome_vfs_make_uri_from_shell_arg (locale_archive);
+			file = g_file_new_for_uri (locale_archive);
+			uri = g_file_get_uri (file);
+			g_object_unref (file);
 			g_free (locale_archive);
 
 			fr_window_archive_open (FR_WINDOW (window), uri, GTK_WINDOW (window));

commit dadb0db4435e67ba163a1bb36dbe856e90450b2a
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Fri Feb 29 00:21:36 2008 +0100

    Switch CommandData structure in main.h from GnomeVFSMimeApplication to GAppInfo.

diff --git a/src/main.c b/src/main.c
index b9ea542..5eb08e9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -312,7 +312,7 @@ command_done (CommandData *cdata)
 	}
 
 	g_free (cdata->command);
-	gnome_vfs_mime_application_free (cdata->app);
+	g_object_unref (cdata->app);
 	path_list_free (cdata->file_list);
 	g_free (cdata->temp_dir);
 	if (cdata->process != NULL)
diff --git a/src/main.h b/src/main.h
index cad7782..f09cfb4 100644
--- a/src/main.h
+++ b/src/main.h
@@ -26,7 +26,7 @@
 
 #include <glib.h>
 #include <glib/gi18n.h>
-#include <libgnomevfs/gnome-vfs-mime-handlers.h>
+#include <gio/gio.h>
 #include "preferences.h"
 #include "fr-process.h"
 #include "fr-window.h"
@@ -44,7 +44,7 @@ typedef struct {
 	FrWindow                *window;
 	FrProcess               *process;
 	char                    *command;
-	GnomeVFSMimeApplication *app;
+	GAppInfo                *app;
 	GList                   *file_list;
 	char                    *temp_dir;
 } CommandData;

commit 630beff9514ad42e7778f042cdabe7c09932b87b
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Fri Feb 29 00:06:29 2008 +0100

    Rerun autogen to update configure for added gio-2.0 module.

diff --git a/configure b/configure
index 5d94463..63945fb 100755
--- a/configure
+++ b/configure
@@ -19698,6 +19698,7 @@ if test -n "$PKG_CONFIG"; then
 	libgnomeui-2.0 >= \$LIBGNOMEUI_REQUIRED		\\
 	gnome-vfs-2.0 >= \$GNOME_VFS_REQUIRED		\\
 	gnome-vfs-module-2.0				\\
+	gio-2.0						\\
 	libglade-2.0 >= \$LIBGLADE_REQUIRED\"") >&5
   ($PKG_CONFIG --exists --print-errors "\
 	glib-2.0 >= $GLIB_REQUIRED			\
@@ -19707,6 +19708,7 @@ if test -n "$PKG_CONFIG"; then
 	libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED		\
 	gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED		\
 	gnome-vfs-module-2.0				\
+	gio-2.0						\
 	libglade-2.0 >= $LIBGLADE_REQUIRED") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
@@ -19719,6 +19721,7 @@ if test -n "$PKG_CONFIG"; then
 	libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED		\
 	gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED		\
 	gnome-vfs-module-2.0				\
+	gio-2.0						\
 	libglade-2.0 >= $LIBGLADE_REQUIRED" 2>/dev/null`
 else
   pkg_failed=yes
@@ -19740,6 +19743,7 @@ if test -n "$PKG_CONFIG"; then
 	libgnomeui-2.0 >= \$LIBGNOMEUI_REQUIRED		\\
 	gnome-vfs-2.0 >= \$GNOME_VFS_REQUIRED		\\
 	gnome-vfs-module-2.0				\\
+	gio-2.0						\\
 	libglade-2.0 >= \$LIBGLADE_REQUIRED\"") >&5
   ($PKG_CONFIG --exists --print-errors "\
 	glib-2.0 >= $GLIB_REQUIRED			\
@@ -19749,6 +19753,7 @@ if test -n "$PKG_CONFIG"; then
 	libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED		\
 	gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED		\
 	gnome-vfs-module-2.0				\
+	gio-2.0						\
 	libglade-2.0 >= $LIBGLADE_REQUIRED") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
@@ -19761,6 +19766,7 @@ if test -n "$PKG_CONFIG"; then
 	libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED		\
 	gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED		\
 	gnome-vfs-module-2.0				\
+	gio-2.0						\
 	libglade-2.0 >= $LIBGLADE_REQUIRED" 2>/dev/null`
 else
   pkg_failed=yes
@@ -19788,6 +19794,7 @@ fi
 	libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED		\
 	gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED		\
 	gnome-vfs-module-2.0				\
+	gio-2.0						\
 	libglade-2.0 >= $LIBGLADE_REQUIRED"`
         else
 	        FR_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "\
@@ -19798,6 +19805,7 @@ fi
 	libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED		\
 	gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED		\
 	gnome-vfs-module-2.0				\
+	gio-2.0						\
 	libglade-2.0 >= $LIBGLADE_REQUIRED"`
         fi
 	# Put the nasty error message in config.log where it belongs
@@ -19811,6 +19819,7 @@ fi
 	libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED		\
 	gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED		\
 	gnome-vfs-module-2.0				\
+	gio-2.0						\
 	libglade-2.0 >= $LIBGLADE_REQUIRED) were not met:
 
 $FR_PKG_ERRORS
@@ -19830,6 +19839,7 @@ echo "$as_me: error: Package requirements (\
 	libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED		\
 	gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED		\
 	gnome-vfs-module-2.0				\
+	gio-2.0						\
 	libglade-2.0 >= $LIBGLADE_REQUIRED) were not met:
 
 $FR_PKG_ERRORS
@@ -19886,8 +19896,8 @@ fi
 
 if test x"$enable_nautilus_actions" != xno; then
 	if pkg-config --atleast-version=$NAUTILUS_REQUIRED libnautilus-extension; then
-		NAUTILUS_CFLAGS=`pkg-config --cflags libnautilus-extension glib-2.0 gnome-vfs-2.0`
-		NAUTILUS_LIBS=`pkg-config --libs libnautilus-extension glib-2.0 gnome-vfs-2.0`
+		NAUTILUS_CFLAGS=`pkg-config --cflags libnautilus-extension glib-2.0 gnome-vfs-2.0 gio-2.0`
+		NAUTILUS_LIBS=`pkg-config --libs libnautilus-extension glib-2.0 gnome-vfs-2.0 gio-2.0`
 		build_nautilus_actions=yes
 	fi
 fi

commit 79ebea5da5dc4c2fcf9d056d4e4da3fb9598cea7
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Thu Feb 28 23:49:18 2008 +0100

    Port the file-roller nautilus plugin to gio.

diff --git a/nautilus/nautilus-fileroller.c b/nautilus/nautilus-fileroller.c
index 57f5042..7ada460 100644
--- a/nautilus/nautilus-fileroller.c
+++ b/nautilus/nautilus-fileroller.c
@@ -24,9 +24,7 @@
 #include <config.h>
 #include <string.h>
 #include <glib/gi18n-lib.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-#include <libgnomevfs/gnome-vfs-file-info.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
+#include <gio/gio.h>
 #include <libnautilus-extension/nautilus-extension-types.h>
 #include <libnautilus-extension/nautilus-file-info.h>
 #include <libnautilus-extension/nautilus-menu-provider.h>
@@ -212,20 +210,21 @@ nautilus_fr_get_file_items (NautilusMenuProvider *provider,
 
 		if (can_write) {
 			char             *parent_uri;
-			GnomeVFSFileInfo *info;
-			GnomeVFSResult    result;
+			GFile            *f;
+			GFileInfo        *info;
+			GError           *err = NULL;
 
 			parent_uri = nautilus_file_info_get_parent_uri (file);
-			info = gnome_vfs_file_info_new ();
+			f = g_file_new_for_uri (parent_uri);
 			
-			result = gnome_vfs_get_file_info (parent_uri,
-							  info,
-							  (GNOME_VFS_FILE_INFO_FOLLOW_LINKS
-					                   | GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS));
-			if ((result == GNOME_VFS_OK) && (info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS))
-				can_write = (info->permissions & GNOME_VFS_PERM_ACCESS_WRITABLE) || (info->permissions & GNOME_VFS_PERM_USER_WRITE);
-				
-			gnome_vfs_file_info_unref (info);
+			info = g_file_query_info (f, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE, 0, NULL, &err);
+			if (info) {
+				can_write = g_file_info_get_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE);
+			}
+
+			g_error_free (err);
+			g_object_unref (info);
+			g_object_unref (f);
 			g_free (parent_uri);
 		}
 	}

commit 5cab64e0f3adeb2a327a89f0802560c79097a698
Author: Andreas Henriksson <andreas@fatal.se>
Date:   Thu Feb 28 23:41:01 2008 +0100

    Add gio-2.0 to build files along side gnome-vfs.

diff --git a/configure.in b/configure.in
index 0ffa513..f81ab4d 100644
--- a/configure.in
+++ b/configure.in
@@ -44,6 +44,7 @@ PKG_CHECK_MODULES(FR,					\
 	libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED		\
 	gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED		\
 	gnome-vfs-module-2.0				\
+	gio-2.0						\
 	libglade-2.0 >= $LIBGLADE_REQUIRED)
 AC_SUBST(FR_CFLAGS)
 AC_SUBST(FR_LIBS)
@@ -56,8 +57,8 @@ AC_ARG_ENABLE(nautilus_actions, AC_HELP_STRING([--disable-nautilus-actions],[don
 
 if test x"$enable_nautilus_actions" != xno; then
 	if pkg-config --atleast-version=$NAUTILUS_REQUIRED libnautilus-extension; then
-		NAUTILUS_CFLAGS=`pkg-config --cflags libnautilus-extension glib-2.0 gnome-vfs-2.0`
-		NAUTILUS_LIBS=`pkg-config --libs libnautilus-extension glib-2.0 gnome-vfs-2.0`
+		NAUTILUS_CFLAGS=`pkg-config --cflags libnautilus-extension glib-2.0 gnome-vfs-2.0 gio-2.0`
+		NAUTILUS_LIBS=`pkg-config --libs libnautilus-extension glib-2.0 gnome-vfs-2.0 gio-2.0`
 		build_nautilus_actions=yes
 	fi
 fi
