Index: tests/test-widget.c
===================================================================
--- tests/test-widget.c	(revision 1890)
+++ tests/test-widget.c	(working copy)
@@ -29,6 +29,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#include <gio/gio.h>
 #include <gtk/gtk.h>
 #include <gtksourceview/gtksourceview.h>
 #include <gtksourceview/gtksourcelanguage.h>
@@ -38,11 +39,6 @@
 #ifdef TEST_XML_MEM
 #include <libxml/xmlreader.h>
 #endif
-#ifdef USE_GNOME_VFS
-#include <libgnomevfs/gnome-vfs-init.h>
-#include <libgnomevfs/gnome-vfs-mime-utils.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-#endif
 
 /* Global list of open windows */
 
@@ -256,7 +252,7 @@
 
 static gboolean
 gtk_source_buffer_load_file (GtkSourceBuffer *source_buffer,
-			     const gchar     *filename,
+			     GFile           *file,
 			     GError         **error)
 {
 	GtkTextIter iter;
@@ -264,12 +260,14 @@
 	GError *error_here = NULL;
 
 	g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (source_buffer), FALSE);
-	g_return_val_if_fail (filename != NULL, FALSE);
+	g_return_val_if_fail (file != NULL, FALSE);
 
-	if (!g_file_get_contents (filename, &buffer, NULL, &error_here))
+	if (!g_file_load_contents (file, NULL, &buffer, NULL, NULL, &error_here))
 	{
+		gchar *filename = g_file_get_parse_name (file);
 		error_dialog (NULL, "%s\nFile %s", error_here->message, filename);
 		g_propagate_error (error, error_here);
+		g_free (filename);
 		return FALSE;
 	}
 
@@ -395,38 +393,33 @@
 }
 
 static GtkSourceLanguage *
-get_language_for_file (const gchar *filename)
+get_language_for_file (GFile *file)
 {
 	GtkSourceLanguage *language = NULL;
+	GFileInfo *info;
+	
+	info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+	                          0, NULL, NULL);
 
-#if defined(USE_GNOME_VFS)
-	gchar *mime_type;
-	gchar *uri;
-
-	/* I hate this! */
-	if (g_path_is_absolute (filename))
+	if (info)
 	{
-		uri = gnome_vfs_get_uri_from_local_path (filename);
+		const char *content_type;
+		char *mime_type;
+		
+		content_type = g_file_info_get_content_type (info);
+		if ((mime_type = g_content_type_get_mime_type (content_type)))
+			language = get_language_for_mime_type (mime_type);
+		
+		g_free (mime_type);
+		g_object_unref (info);
 	}
-	else
-	{
-		gchar *curdir, *path;
-		curdir = g_get_current_dir ();
-		path = g_strconcat (curdir, "/", filename, NULL);
-		g_free (curdir);
-		uri = gnome_vfs_get_uri_from_local_path (path);
-		g_free (path);
-	}
 
-	if ((mime_type = gnome_vfs_get_mime_type (uri)))
-		language = get_language_for_mime_type (mime_type);
-
-	g_free (mime_type);
-	g_free (uri);
-#endif
-
 	if (!language)
+	{
+		gchar *filename = g_file_get_uri (file);
 		language = get_language_for_filename (filename);
+		g_free (filename);
+	}
 
 	return language;
 }
@@ -440,7 +433,7 @@
 }
 
 static GtkSourceLanguage *
-get_language (GtkTextBuffer *buffer, const gchar *filename)
+get_language (GtkTextBuffer *buffer, GFile *file)
 {
 	GtkSourceLanguage *language = NULL;
 	GtkTextIter start, end;
@@ -470,7 +463,7 @@
 	}
 
 	if (!language)
-		language = get_language_for_file (filename);
+		language = get_language_for_file (file);
 
 	g_free (text);
 	return language;
@@ -482,23 +475,16 @@
 	GtkSourceLanguage *language = NULL;
 	gchar *freeme = NULL;
 	gboolean success = FALSE;
+	GFile *file = g_file_new_for_commandline_arg (filename);
 
-	if (!g_path_is_absolute (filename))
-	{
-		gchar *curdir = g_get_current_dir ();
-		freeme = g_build_filename (curdir, filename, NULL);
-		filename = freeme;
-		g_free (curdir);
-	}
-
 	remove_all_marks (buffer);
 
-	success = gtk_source_buffer_load_file (buffer, filename, NULL);
+	success = gtk_source_buffer_load_file (buffer, file, NULL);
 
 	if (!success)
 		goto out;
 
-	language = get_language (GTK_TEXT_BUFFER (buffer), filename);
+	language = get_language (GTK_TEXT_BUFFER (buffer), file);
 
 	if (language == NULL)
 		g_print ("No language found for file `%s'\n", filename);
@@ -540,6 +526,7 @@
 		g_print("\n");
 	}
 out:
+	g_object_unref (file);
 	g_free (freeme);
 	return success;
 }
@@ -1520,10 +1507,6 @@
 
 // 	gdk_window_set_debug_updates (TRUE);
 
-#ifdef USE_GNOME_VFS
-	gnome_vfs_init ();
-#endif
-
 	/* we do not use defaults so we don't need to install the library */
 	lang_dirs = use_default_paths ? NULL : builtin_lang_dirs;
 	lm = gtk_source_language_manager_get_default ();
@@ -1593,9 +1576,5 @@
 
 	g_free (style_scheme_id);
 
-#ifdef USE_GNOME_VFS
-	gnome_vfs_shutdown ();
-#endif
-
 	return 0;
 }
Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am	(revision 1890)
+++ tests/Makefile.am	(working copy)
@@ -1,7 +1,3 @@
-if USE_GNOME_VFS
-GVFS_FLAG = -DUSE_GNOME_VFS
-endif
-
 INCLUDES = 				\
 	-DDATADIR=\""$(datadir)"\" 	\
 	-DG_LOG_DOMAIN=\"GtkSourceView\"\
@@ -10,7 +6,6 @@
 	$(DISABLE_DEPRECATED_CFLAGS)	\
 	$(WARN_CFLAGS) 			\
 	$(DEP_CFLAGS)			\
-	$(GVFS_FLAG)			\
 	$(TESTS_CFLAGS)
 
 # testing executables
Index: configure.ac
===================================================================
--- configure.ac	(revision 1890)
+++ configure.ac	(working copy)
@@ -87,15 +87,12 @@
 
 msg_tests=no
 AM_CONDITIONAL(BUILD_TESTS, false)
-AM_CONDITIONAL(USE_GNOME_VFS, false)
 
 if test x$build_tests = xtrue; then
 	AM_CONDITIONAL(BUILD_TESTS, true)
 	AC_DEFINE(BUILD_TESTS, [], [build test suite])
 	msg_tests=yes
-	PKG_CHECK_MODULES(TESTS, gnome-vfs-2.0,
-			  AM_CONDITIONAL(USE_GNOME_VFS, true),
-			  [PKG_CHECK_MODULES(TESTS, gthread-2.0)])
+	PKG_CHECK_MODULES(TESTS, gthread-2.0 gio-2.0)
         # test-widget uses this to find lang files and gtksourcebuffer.c
         ABS_TOP_SRCDIR=`cd $srcdir && pwd`
         AC_SUBST(ABS_TOP_SRCDIR)
Index: INSTALL
===================================================================
--- INSTALL	(revision 1890)
+++ INSTALL	(working copy)
@@ -1,8 +1,8 @@
 Installation Instructions
 *************************
 
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
-Software Foundation, Inc.
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006 Free Software Foundation, Inc.
 
 This file is free documentation; the Free Software Foundation gives
 unlimited permission to copy, distribute and modify it.
@@ -10,7 +10,10 @@
 Basic Installation
 ==================
 
-These are generic installation instructions.
+Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package.  The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
 
    The `configure' shell script attempts to guess correct values for
 various system-dependent variables used during compilation.  It uses
@@ -23,9 +26,9 @@
 
    It can also use an optional file (typically called `config.cache'
 and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring.  (Caching is
+the results of its tests to speed up reconfiguring.  Caching is
 disabled by default to prevent problems with accidental use of stale
-cache files.)
+cache files.
 
    If you need to do unusual things to compile the package, please try
 to figure out how `configure' could check whether to do them, and mail
@@ -35,20 +38,17 @@
 may remove or edit it.
 
    The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'.  You only need
-`configure.ac' if you want to change it or regenerate `configure' using
-a newer version of `autoconf'.
+`configure' by a program called `autoconf'.  You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
 
 The simplest way to compile this package is:
 
   1. `cd' to the directory containing the package's source code and type
-     `./configure' to configure the package for your system.  If you're
-     using `csh' on an old version of System V, you might need to type
-     `sh ./configure' instead to prevent `csh' from trying to execute
-     `configure' itself.
+     `./configure' to configure the package for your system.
 
-     Running `configure' takes awhile.  While running, it prints some
-     messages telling which features it is checking for.
+     Running `configure' might take a while.  While running, it prints
+     some messages telling which features it is checking for.
 
   2. Type `make' to compile the package.
 
@@ -78,7 +78,7 @@
 by setting variables in the command line or in the environment.  Here
 is an example:
 
-     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
 
    *Note Defining Variables::, for more details.
 
@@ -87,17 +87,15 @@
 
 You can compile the package for more than one kind of computer at the
 same time, by placing the object files for each architecture in their
-own directory.  To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'.  `cd' to the
+own directory.  To do this, you can use GNU `make'.  `cd' to the
 directory where you want the object files and executables to go and run
 the `configure' script.  `configure' automatically checks for the
 source code in the directory that `configure' is in and in `..'.
 
-   If you have to use a `make' that does not support the `VPATH'
-variable, you have to compile the package for one architecture at a
-time in the source code directory.  After you have installed the
-package for one architecture, use `make distclean' before reconfiguring
-for another architecture.
+   With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory.  After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
 
 Installation Names
 ==================
@@ -190,12 +188,12 @@
      ./configure CC=/usr/local2/bin/gcc
 
 causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script).  Here is a another example:
+overridden in the site shell script).
 
-     /bin/bash ./configure CONFIG_SHELL=/bin/bash
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug.  Until the bug is fixed you can use this workaround:
 
-Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
-configuration-related scripts to be executed by `/bin/bash'.
+     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
 
 `configure' Invocation
 ======================
