Index: ChangeLog
===================================================================
--- ChangeLog	(Revision 4581)
+++ ChangeLog	(Arbeitskopie)
@@ -1,3 +1,12 @@
+2009-01-13  Jens Georg  <jens@einstein>
+
+	* plugins/debug-manager/start.c: 
+	* plugins/debug-manager/plugin.c: 
+	* plugins/debug-manager/threads.c: 
+	* plugins/debug-manager/stack_trace.c: 
+	* plugins/debug-manager/breakpoints.c: 
+	fix #511589 for debug-manager plugin
+
 2009-01-12  Massimo Cora'  <mcora@svn.gnome.org>
 
 	* plugins/symbol-db/plugin.c (do_update_project_symbols),
Index: plugins/debug-manager/threads.c
===================================================================
--- plugins/debug-manager/threads.c	(Revision 4581)
+++ plugins/debug-manager/threads.c	(Arbeitskopie)
@@ -29,8 +29,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <ctype.h>
-#include <gnome.h>
-#include <libgnomevfs/gnome-vfs.h>
+#include <gio/gio.h>
 
 /*#define DEBUG*/
 #include <libanjuta/resources.h>
@@ -223,8 +222,10 @@
 	{
 		if (g_path_is_absolute (frame->file))
 		{					
-			uri = gnome_vfs_get_uri_from_local_path(frame->file);
+			GFile *gio_file = g_file_new_for_path (frame->file);
+			uri = g_file_get_uri (gio_file);
 			file = strrchr(frame->file, G_DIR_SEPARATOR) + 1;
+			g_object_unref (gio_file);
 		}
 		else
 		{
@@ -325,8 +326,10 @@
 			{
 				if (g_path_is_absolute (frame->file))
 				{					
-					uri = gnome_vfs_get_uri_from_local_path(frame->file);
+					GFile *gio_file = g_file_new_for_path (frame->file);
+					uri = g_file_get_uri (gio_file);
 					file = strrchr(frame->file, G_DIR_SEPARATOR) + 1;
+					g_object_unref (gio_file);
 				}
 				else
 				{
Index: plugins/debug-manager/plugin.c
===================================================================
--- plugins/debug-manager/plugin.c	(Revision 4581)
+++ plugins/debug-manager/plugin.c	(Arbeitskopie)
@@ -50,7 +50,7 @@
 #include <libanjuta/interfaces/ianjuta-document-manager.h>
 #include <libanjuta/interfaces/ianjuta-message-manager.h>
 
-#include <libgnomevfs/gnome-vfs.h>
+#include <gio/gio.h>
 
 /* Contants defintion
  *---------------------------------------------------------------------------*/
Index: plugins/debug-manager/breakpoints.c
===================================================================
--- plugins/debug-manager/breakpoints.c	(Revision 4581)
+++ plugins/debug-manager/breakpoints.c	(Arbeitskopie)
@@ -49,8 +49,7 @@
 #include <string.h>
 #include <ctype.h>
 
-#include <gnome.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
+#include <gio/gio.h>
 
 #include <libanjuta/resources.h>
 #include <libanjuta/anjuta-debug.h>
@@ -155,7 +154,11 @@
 		bi->bp.file = g_strdup (bp->file);
 		bi->bp.line = bp->line;
 		if ((bi->uri == NULL) && (g_path_is_absolute (bp->file)))
-			bi->uri = gnome_vfs_get_uri_from_local_path (bp->file);
+		{
+			GFile *file = g_file_new_for_path (bp->file);
+			bi->uri = g_file_get_uri (file);
+			g_object_unref (file);
+		}
 	}
 	if (bp->type & IANJUTA_DEBUGGER_BREAKPOINT_ON_FUNCTION)
 	{
@@ -259,7 +262,7 @@
 	if (uri != NULL)
 	{
 		bi->uri = g_strdup (uri);
-		bi->bp.file = gnome_vfs_get_local_path_from_uri (uri);
+		bi->bp.file = anjuta_util_get_local_path_from_uri (uri);
 		bi->bp.line = line;
 	}
 	bi->bp.enable = enable;
@@ -290,7 +293,7 @@
 	else if ((uri != NULL) && isdigit (*string))
 	{
 		bi->uri = g_strdup (uri);
-		bi->bp.file = gnome_vfs_get_local_path_from_uri (uri);
+		bi->bp.file = anjuta_util_get_local_path_from_uri (uri);
 		bi->bp.line = strtoul (string, NULL, 10);
 		bi->bp.type = IANJUTA_DEBUGGER_BREAKPOINT_ON_LINE;
 	}
@@ -321,7 +324,9 @@
 			bi->bp.file = g_strndup (string, ptr - string);
 			if (g_path_is_absolute (bi->bp.file))
 			{
-				bi->uri = gnome_vfs_get_uri_from_local_path (bi->bp.file);
+				GFile *file = g_file_new_for_path (bi->bp.file);
+				bi->uri = g_file_get_uri (file);
+				g_object_unref (file);
 			}
 		}
 	}
Index: plugins/debug-manager/stack_trace.c
===================================================================
--- plugins/debug-manager/stack_trace.c	(Revision 4581)
+++ plugins/debug-manager/stack_trace.c	(Arbeitskopie)
@@ -27,14 +27,14 @@
 #include <unistd.h>
 #include <string.h>
 #include <ctype.h>
-#include <gnome.h>
 
+#include <gio/gio.h>
+
 /*#define DEBUG*/
 #include <libanjuta/resources.h>
 #include <libanjuta/anjuta-debug.h>
 #include <libanjuta/interfaces/ianjuta-editor.h>
 #include <libanjuta/interfaces/ianjuta-document-manager.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
 
 #include "utilities.h"
 #include "info.h"
@@ -292,8 +292,10 @@
 		{
 			if (g_path_is_absolute (frame->file))
 			{					
-				uri = gnome_vfs_get_uri_from_local_path(frame->file);
+				GFile *gio_file = g_file_new_for_path (frame->file);
+				uri = g_file_get_uri (gio_file);
 				file = strrchr(frame->file, G_DIR_SEPARATOR) + 1;
+				g_object_unref (gio_file);
 			}
 			else
 			{
Index: plugins/debug-manager/Makefile.am
===================================================================
--- plugins/debug-manager/Makefile.am	(Revision 4581)
+++ plugins/debug-manager/Makefile.am	(Arbeitskopie)
@@ -14,6 +14,7 @@
 AM_CPPFLAGS= \
 	$(WARN_CFLAGS) \
 	$(DEPRECATED_FLAGS) \
+	$(GIO_CFLAGS) \
 	$(LIBANJUTA_CFLAGS)
 
 plugindir = $(anjuta_plugin_dir)
@@ -22,8 +23,8 @@
 libanjuta_debug_manager_la_LDFLAGS = $(ANJUTA_PLUGIN_LDFLAGS)
 
 libanjuta_debug_manager_la_LIBADD = \
-	$(GNOME_UI_LIBS) \
 	$(GLADE_LIBS) \
+	$(GIO_LIBS) \
 	$(LIBANJUTA_LIBS)
 
 # Marshallers
Index: plugins/debug-manager/start.c
===================================================================
--- plugins/debug-manager/start.c	(Revision 4581)
+++ plugins/debug-manager/start.c	(Arbeitskopie)
@@ -42,10 +42,8 @@
 #include <libanjuta/interfaces/ianjuta-file-savable.h>
 #include <libanjuta/anjuta-utils.h>
 
-#include <libgnomevfs/gnome-vfs-mime-utils.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-
 #include <glade/glade-xml.h>
+#include <gio/gio.h>
 
 #include <errno.h>
 #include <sys/stat.h>
@@ -181,10 +179,13 @@
 	GList *slibs_dirs = NULL;
 	GList *libs_dirs = NULL;
 	GValue value = {0,};
+	GFile *file;
 
 	return NULL;
 	cwd = g_get_current_dir();
-	search_dirs = g_list_prepend (search_dirs, gnome_vfs_get_uri_from_local_path(cwd));
+	file = g_file_new_for_path (cwd);
+	search_dirs = g_list_prepend (search_dirs, g_file_get_uri (file));
+	g_object_unref (file);
 	g_free (cwd);
 
 	/* Check if a project is already open */
@@ -854,7 +855,7 @@
 	
 	if (dir_uri != NULL)
 	{
-		dir = gnome_vfs_get_local_path_from_uri (dir_uri);
+		dir = anjuta_util_get_local_path_from_uri (dir_uri);
 		g_free (dir_uri);
 	}
 	else
@@ -893,20 +894,45 @@
 {
 	gchar *mime_type;
 	gchar *filename;
+	GFile *file;
+	GFileInfo *file_info;
+	GError *error = NULL;
 	
-	mime_type = gnome_vfs_get_mime_type ((const gchar *)target);
+	DEBUG_PRINT ("Using target %s", target);
+	file = g_file_new_for_uri (target);
+	file_info = g_file_query_info (file, 
+			G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+			G_FILE_QUERY_INFO_NONE,
+			NULL, &error);
+	if (file_info == NULL)
+	{
+		DEBUG_PRINT ("Error getting file info: %s", error->message);
+		g_error_free (error);
+		anjuta_util_dialog_error(GTK_WINDOW (this->plugin->shell),
+				_("Unable to open %s. (file_info) Debugger cannot start."), target);
+		g_object_unref (file);
+		return FALSE;
+	}
+
+	mime_type = g_file_info_get_attribute_as_string (file_info, 
+			G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE);
 	if (mime_type == NULL)
 	{
 		anjuta_util_dialog_error(GTK_WINDOW (this->plugin->shell),
-				_("Unable to open %s. Debugger cannot start."), target);
+				_("Unable to open %s. (mime_type) Debugger cannot start."), target);
+		g_object_unref (file_info);
+		g_object_unref (file);
 		return FALSE;
 	}
-	filename = gnome_vfs_get_local_path_from_uri (target);
+
+	filename = g_file_get_path (file);
 	
 	dma_queue_load (this->debugger, filename, mime_type, this->source_dirs);
 
 	g_free (filename);
 	g_free (mime_type);
+	g_object_unref (file_info);
+	g_object_unref (file);
 
 	return TRUE;
 }
@@ -988,14 +1014,16 @@
 static gboolean
 dma_start_load_and_start_uri (DmaStart *this, const gchar *target)
 {
-	GnomeVFSURI *vfs_uri;
+	gchar *local_path = NULL;
 
 	if (!dma_quit_debugger (this)) return FALSE;
 	
-	vfs_uri = gnome_vfs_uri_new (target);
-	g_return_val_if_fail (vfs_uri != NULL, TRUE);
-	if (!gnome_vfs_uri_is_local (vfs_uri)) return FALSE;
-	gnome_vfs_uri_unref (vfs_uri);
+	local_path = anjuta_util_get_local_path_from_uri (target);
+	if (!local_path)
+	{
+		return FALSE;
+	}
+	g_free (local_path);
 	
 	return check_target (this, target);
 }
@@ -1113,7 +1141,7 @@
 	GtkTreeIter iter;
 	gchar *local;
 	
-	local = gnome_vfs_get_local_path_from_uri ((const char *)data);
+	local = anjuta_util_get_local_path_from_uri ((const char *)data);
 	gtk_list_store_append (model, &iter);
 	gtk_list_store_set (model, &iter, 0, local, -1);
 	g_free (local);
@@ -1125,10 +1153,13 @@
 	GList** list = (GList **)user_data;
 	gchar* dir;
 	gchar* uri;
+	GFile *file;
 
 	gtk_tree_model_get (model, iter, 0, &dir, -1);
-	uri =  gnome_vfs_get_uri_from_local_path (dir);
+	file = g_file_new_for_path (dir);
+	uri =  g_file_get_uri (file);
 	*list = g_list_prepend (*list, uri);
+	g_object_unref (file);
 	g_free (dir);
 	
 	return FALSE;
