Index: configure.ac
===================================================================
--- configure.ac	(revision 7786)
+++ configure.ac	(working copy)
@@ -73,7 +73,8 @@
 dnl pkg-config check time
 dnl *****************************************
 
-GLIB_REQUIRED=2.14.0
+GLIB_REQUIRED=2.15.0
+GIO_REQUIRED=2.15.0
 GTK_REQUIRED=2.11.6
 LIBGNOME_DESKTOP_REQUIRED=2.9.91
 LIBGNOME_REQUIRED=2.13.2
@@ -90,6 +91,7 @@
 dnl *****************************************
 
 PKG_CHECK_MODULES(GNOME_UTILS, glib-2.0 >= $GLIB_REQUIRED dnl
+                               gio-2.0 >= $GIO_REQUIRED dnl
                                gtk+-2.0 >= $GTK_REQUIRED dnl
                                libgnome-2.0 >= $LIBGNOME_REQUIRED dnl
                                libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED)
Index: baobab/src/baobab-scan.c
===================================================================
--- baobab/src/baobab-scan.c	(revision 7786)
+++ baobab/src/baobab-scan.c	(working copy)
@@ -27,7 +27,7 @@
 
 #include <glib.h>
 #include <gtk/gtk.h>
-#include <libgnomevfs/gnome-vfs.h>
+#include <gio/gio.h>
 
 #include "baobab.h"
 #include "baobab-scan.h"
@@ -45,7 +45,7 @@
    number of files with st_nlink > 1 on average computer.
 
    To save memory, we store only { inode, dev } instead of full
-   GnomeVfsFileInfo.
+   GFileInfo.
 
    EDIT: /me stupid. I realize that this code was not called that often
    1 call per file with st_nlink > 1. BUT, i'm using pdumpfs to backup
@@ -54,7 +54,7 @@
 */
 
 typedef struct {
-	GnomeVFSInodeNumber inode;
+	guint64             inode;
 	dev_t               device;
 } BaobabHardLink;
 
@@ -68,7 +68,7 @@
 
 static gboolean
 baobab_hardlinks_array_has (BaobabHardLinkArray *a,
-			    GnomeVFSFileInfo    *s)
+			    GFileInfo           *s)
 {
 	guint i;
 
@@ -79,7 +79,10 @@
 		 * cur->st_dev == s->st_dev is the common case and may be more
 		 * expansive than cur->st_ino == s->st_ino
 		 * so keep this order */
-		if (cur->inode == s->inode && cur->device == s->device)
+		if (cur->inode == g_file_info_get_attribute_uint64 (s,
+							G_FILE_ATTRIBUTE_UNIX_INODE) &&
+		    cur->device == g_file_info_get_attribute_uint32 (s,
+							G_FILE_ATTRIBUTE_UNIX_DEVICE))
 			return TRUE;
 	}
 
@@ -89,15 +92,17 @@
 /* return FALSE if the element was already in the array */
 static gboolean
 baobab_hardlinks_array_add (BaobabHardLinkArray *a,
-			    GnomeVFSFileInfo    *s)
+			    GFileInfo           *s)
 {
 	BaobabHardLink hl;
 
 	if (baobab_hardlinks_array_has (a, s))
 		return FALSE;
 
-	hl.inode = s->inode;
-	hl.device = s->device;
+	hl.inode = g_file_info_get_attribute_uint64 (s,
+				G_FILE_ATTRIBUTE_UNIX_INODE);
+	hl.device = g_file_info_get_attribute_uint32 (s,
+				G_FILE_ATTRIBUTE_UNIX_DEVICE);
 
 	g_array_append_val (a, hl);
 
@@ -115,60 +120,90 @@
 #define BLOCK_SIZE 512
 
 struct allsizes {
-	GnomeVFSFileSize size;
-	GnomeVFSFileSize alloc_size;
+	goffset size;
+	goffset alloc_size;
 };
 
+static const char *dir_attributes = 
+	G_FILE_ATTRIBUTE_STANDARD_NAME "," G_FILE_ATTRIBUTE_STANDARD_TYPE "," \
+	G_FILE_ATTRIBUTE_STANDARD_SIZE "," G_FILE_ATTRIBUTE_UNIX_BLOCKS "," \
+	G_FILE_ATTRIBUTE_ACCESS_CAN_READ;
+
+static const char *child_attributes =
+	G_FILE_ATTRIBUTE_STANDARD_NAME "," G_FILE_ATTRIBUTE_STANDARD_TYPE "," \
+	G_FILE_ATTRIBUTE_UNIX_INODE "," G_FILE_ATTRIBUTE_UNIX_DEVICE;
+
 static struct allsizes
-loopdir (GnomeVFSURI *vfs_uri_dir,
-	 GnomeVFSFileInfo *dir_info,
+loopdir (GFile *dir,
 	 guint count,
 	 BaobabHardLinkArray *hla)
 {
 	GList *file_list;
-	guint64 tempHLsize;
-	gint elements;
+	guint64 tempHLsize = 0;
+	gint elements = 0;
 	struct chan_data data;
-	struct allsizes retloop;
-	struct allsizes temp;
-	GnomeVFSResult result;
-	gchar *dir;
-	gchar *string_to_display;
-	GnomeVFSURI *new_uri;
+	struct allsizes retloop, temp;
+	GFileInfo *dir_info, *temp_info;
+	GFileEnumerator *file_enum;
+	gchar *dir_uri = NULL;
+	gchar *dir_path = NULL;
+	gchar *string_to_display = NULL;
+	GError *err = NULL;
 
 	count++;
-	elements = 0;
-	tempHLsize = 0;
 	retloop.size = 0;
 	retloop.alloc_size = 0;
-	dir = NULL;
-	string_to_display = NULL;
+	dir_uri = g_file_get_uri (dir);
+	dir_path = g_file_get_path (dir);
 
+	dir_info = g_file_query_info (dir, dir_attributes,
+				      G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
+				      NULL, &err);
+
+	if (dir_info == NULL && err != NULL) {
+		g_warning ("couldn't get info for dir %s: %s\n",
+			   dir_path,
+			   err->message);
+	}
+
 	/* Skip the virtual file systems */
-	if ((strcmp (gnome_vfs_uri_get_path (vfs_uri_dir), "/proc") == 0) ||
-            (strcmp (gnome_vfs_uri_get_path (vfs_uri_dir), "/sys") == 0))
+	if ((strcmp (dir_path, "/proc") == 0) ||
+            (strcmp (dir_path, "/sys") == 0))
 		goto exit;
 
-	dir = gnome_vfs_uri_to_string (vfs_uri_dir, GNOME_VFS_URI_HIDE_NONE);
-
 	/* Skip the user excluded folders */
-	if (is_excluded_dir (dir))
+	if (is_excluded_dir (dir_uri))
 		goto exit;
 
-	if (!baobab.is_local)
-		string_to_display = gnome_vfs_unescape_string_for_display (dir);
-	else
-		string_to_display = gnome_vfs_format_uri_for_display (dir);
+	string_to_display = g_file_get_parse_name (dir);
 
 	/* Folders we can't access (e.g perms 644). Skip'em. */
-	if ((dir_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE) == 0)
-		goto exit;				 
+	if (!g_file_info_get_attribute_boolean(dir_info, G_FILE_ATTRIBUTE_ACCESS_CAN_READ))
+		goto exit;
+	if (g_file_info_get_file_type (dir_info) == G_FILE_TYPE_UNKNOWN)
+		goto exit;
 
-	if ((dir_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE) != 0)
-		retloop.size = dir_info->size;
-	if ((dir_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_BLOCK_COUNT) != 0)
-		retloop.alloc_size = dir_info->block_count * BLOCK_SIZE;
+	if (g_file_info_has_attribute (dir_info, G_FILE_ATTRIBUTE_STANDARD_SIZE))
+		retloop.size = g_file_info_get_size (dir_info);
+	if (g_file_info_has_attribute (dir_info, G_FILE_ATTRIBUTE_UNIX_BLOCKS))
+		retloop.alloc_size = BLOCK_SIZE * 
+			g_file_info_get_attribute_uint64 (dir_info,
+							  G_FILE_ATTRIBUTE_UNIX_BLOCKS);
 
+	/* load up the file enumerator */
+	file_enum = g_file_enumerate_children (dir,
+					child_attributes,
+					G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
+					NULL, &err);
+
+	if (file_enum == NULL && err != NULL) {
+		g_warning ("couldn't get dir enum for dir %s: %s\n",
+			   dir_path,
+			   err->message);
+		goto exit;
+	}
+
+
 	/* All skipped folders (i.e. bad type, excluded, /proc) must be
 	   skept *before* this point. Everything passes the prefill-model
 	   will be part of the GUI. */
@@ -182,64 +217,65 @@
 	data.tempHLsize = tempHLsize;
 	fill_model (&data);
 
-	/* get the GnomeVFSFileInfo stuct for every directory entry */
-	result = gnome_vfs_directory_list_load (&file_list,
-						dir,
-						GNOME_VFS_FILE_INFO_DEFAULT);
+	g_clear_error (&err);
+	while ((temp_info = g_file_enumerator_next_file (file_enum,
+							 NULL,
+							 &err)) != NULL) {
 
-	if (result == GNOME_VFS_OK) {
-		GList *l;
+		GFileType temp_type = g_file_info_get_file_type (temp_info);
 
-		for (l = file_list; l != NULL; l = l->next) {
-			GnomeVFSFileInfo *info = l->data;
+		if (baobab.STOP_SCANNING) {
+			g_object_unref (file_enum);
+			goto exit;
+		}
 
-			if (baobab.STOP_SCANNING) {
-				gnome_vfs_file_info_list_free (file_list);
-				goto exit;
-			}
+		/* is a symlink? */
+		if (temp_type == G_FILE_TYPE_SYMBOLIC_LINK)
+			continue;
 
-			if (strcmp (info->name, ".") == 0 ||
-			    strcmp (info->name, "..") == 0)
-				continue;
+		/* is a directory? */
+		if (temp_type == G_FILE_TYPE_DIRECTORY) {
+			GFile *child_dir = g_file_get_child (dir, 
+						g_file_info_get_name (temp_info));
+			temp = loopdir (child_dir, count, hla);
+			retloop.size += temp.size;
+			retloop.alloc_size += temp.alloc_size;
+			elements++;
+			g_object_unref (child_dir);
+		}
 
-			/* is a symlink? */
-			if (info->type == GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK)
-				continue;
+		/* is it a regular file? */
+		else if (temp_type == G_FILE_TYPE_REGULAR) {
 
-			/* is a directory? */
-			if (info->type == GNOME_VFS_FILE_TYPE_DIRECTORY) {
-				new_uri = gnome_vfs_uri_append_file_name (vfs_uri_dir, info->name);
-				temp = loopdir (new_uri, info, count, hla);
-				retloop.size += temp.size;
-				retloop.alloc_size += temp.alloc_size;
-				elements++;
-				gnome_vfs_uri_unref (new_uri);
-			}
+			/* check for hard links only on local files */
+			if (g_file_info_has_attribute (temp_info,
+						       G_FILE_ATTRIBUTE_UNIX_NLINK) &&
+				g_file_info_get_attribute_uint32 (temp_info,
+							    G_FILE_ATTRIBUTE_UNIX_NLINK) > 1) {
 
-			else if (info->type == GNOME_VFS_FILE_TYPE_REGULAR) {
+				if (!baobab_hardlinks_array_add (hla, temp_info)) {
 
-				/* check for hard links only on local files */
-				if (GNOME_VFS_FILE_INFO_LOCAL (info)) {
-					if (info->link_count > 1) {
-
-						if (!baobab_hardlinks_array_add (hla, info)) {
-
-							/* we already acconted for it */
-							tempHLsize += info->size;
-							continue;
-						}
-					}
+					/* we already acconted for it */
+					tempHLsize += g_file_info_get_size (temp_info);
+					continue;
 				}
+			}
 
-				if ((info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_BLOCK_COUNT) != 0)
-					retloop.alloc_size += (info->block_count * BLOCK_SIZE);
+			if (g_file_info_has_attribute (temp_info, G_FILE_ATTRIBUTE_UNIX_BLOCKS)) {
+				retloop.alloc_size += BLOCK_SIZE *
+					g_file_info_get_attribute_uint64 (temp_info,
+							G_FILE_ATTRIBUTE_UNIX_BLOCKS);
+			}
 
-				retloop.size += info->size;
-				elements++;
-			}
+			retloop.size += g_file_info_get_size (temp_info);
+			elements++;
 		}
+	}
 
-		gnome_vfs_file_info_list_free (file_list);
+	/* won't be an error if we've finished normally */
+	if (err != NULL) {
+		g_warning ("error in dir %s: %s\n", 
+			   dir_path, err->message);
 	}
 
 	data.dir = string_to_display;
@@ -250,8 +286,12 @@
 	data.tempHLsize = tempHLsize;
 	fill_model (&data);
 
+	g_object_unref (file_enum);
+
  exit:
-	g_free (dir);
+ 	g_object_unref (dir_info);
+	g_free (dir_uri);
+	g_free (dir_path);
 	g_free (string_to_display);
 
 	return retloop;
@@ -261,24 +301,17 @@
 getDir (const gchar *uri_dir)
 {
 	BaobabHardLinkArray *hla;
-	GnomeVFSURI *vfs_uri;
-	GnomeVFSFileInfo *info;
+	GFile *dir;
 
 	if (is_excluded_dir (uri_dir))
 		return;
 
 	hla = baobab_hardlinks_array_create ();
 
-	vfs_uri = gnome_vfs_uri_new (uri_dir);
+	dir = g_file_new_for_uri (uri_dir);
 
-	info = gnome_vfs_file_info_new ();
-	gnome_vfs_get_file_info (uri_dir,
-				 info,
-	                         GNOME_VFS_FILE_INFO_DEFAULT);
+	loopdir (dir, 0, hla);
 
-	loopdir (vfs_uri, info, 0, hla);
-
 	baobab_hardlinks_array_free (hla);
-	gnome_vfs_uri_unref (vfs_uri);
-	gnome_vfs_file_info_unref (info);
+	g_object_unref (dir);
 }
