Index: ChangeLog
===================================================================
--- ChangeLog	(revisão 2333)
+++ ChangeLog	(cópia de trabalho)
@@ -1,3 +1,37 @@
+2008-05-14  Gabriel Falcão <gabriel@nacaolivre.org>
+
+	* src/dlg-photo-importer.c: (async_step_done)
+	* src/rotation-utils.c: (apply_transformation_jpeg)
+	* src/catalog-png-exporter.c: (copy_current_file_to_destination_done)
+	* src/gth-window-actions-callbacks.c: set_wallpaper_step_2
+	* src/gth-browser.c: (dir_list_key_press_cb), (key_press_cb),
+	(viewer_drag_data_received), (dir_list_button_release_cb),
+	(catalog_list_button_release_cb), (launch_selected_videos_or_audio):
+	* src/dlg-jpegtran.c: (apply_transformation_done),
+	(apply_transformation__step2), (apply_transformation_to_all_continue),
+	(load_next_image_after_transformation)
+	* src/dlg-reset-exif.c: (apply_transformation_done),
+	(apply_transformation__step2):
+	* src/gth-viewer.c: (viewer_update_open_with_menu)
+	* libgthumb/file-utils.c: 
+	* libgthumb/file-utils.h: Changed the (*CopyDoneFunc) signature to user
+	GError instead of GnomeVFSResult
+	* src/dlg-open-with.c: (open_cb), (app_list_selection_changed_cb),
+	(dlg_open_with):
+	* src/dlg-image-prop.c: (update_general_info)
+
+	GnomeVFSFileInfo migrated to GFileInfo
+	GnomeVFSResult migrated to GError
+	gnome_vfs_escape_string migrated to	g_uri_escape_string
+	GnomeVFSMimeApplication migrated to GAppInfo
+	gnome_vfs_mime_get_description migrated to g_content_type_get_description
+	Using GThemedIcon by GIcon interface from GAppInfo
+
+	When freeing GAppInfo GList's at window closing or g_object_disposing,
+	causes GThumb to crash, so i did avoid unreferencing each GAppInfo got by
+	g_app_info_get_all_by_mime_type (), but this must be tested to avoid memory
+	leaks.
+
 2008-05-16  Michael J. Chudobiak  <mjc@svn.gnome.org>
 
 	* src/gth-viewer.c: (open_with_menu_item_activate_cb),
Index: src/dlg-photo-importer.c
===================================================================
--- src/dlg-photo-importer.c	(revisão 2333)
+++ src/dlg-photo-importer.c	(cópia de trabalho)
@@ -266,7 +266,7 @@
 
 static void
 async_step_done (const char     *uri,
-		 GnomeVFSResult  result,
+		 GError         *error,
                  gpointer        callback_data)
 {
 	AsyncOperationData *aodata = callback_data;
Index: src/rotation-utils.c
===================================================================
--- src/rotation-utils.c	(revisão 2333)
+++ src/rotation-utils.c	(cópia de trabalho)
@@ -25,9 +25,7 @@
 #include <sys/types.h>
 
 #include <glib/gi18n.h>
-#include <libgnomevfs/gnome-vfs-mime.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
+#include <gio/gio.h>
 #include "file-utils.h"
 #include "gconf-utils.h"
 #include "gtk-utils.h"
@@ -148,7 +146,8 @@
 	char             *tmp_output_file = NULL;
 	JXFORM_CODE       transf;
 	char		 *local_file;
-	GnomeVFSFileInfo *info = NULL;
+	GFile            *gfile;
+	GFileInfo        *info;
 
 	if (file == NULL)
 		return FALSE;
@@ -170,10 +169,10 @@
 		result = FALSE;
 		goto apply_transformation_jpeg__free_and_close;
 	}
+	gfile = g_file_new_for_uri (file->path);
+	info = g_file_query_info (gfile, "owner::*,access::*,standard::size", G_FILE_QUERY_INFO_NONE, NULL, NULL);
+	g_object_unref (gfile);
 
-	info = gnome_vfs_file_info_new ();
-	gnome_vfs_get_file_info (file->path, info, GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS | GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
-
 	switch (transform) {
 	case GTH_TRANSFORM_NONE:
 		transf = JXFORM_NONE;
@@ -221,8 +220,10 @@
 		char *local_uri;
 		
 		local_uri = get_uri_from_local_path (local_file);
-		gnome_vfs_set_file_info (local_uri, info, GNOME_VFS_SET_FILE_INFO_PERMISSIONS | GNOME_VFS_SET_FILE_INFO_OWNER);
-		gnome_vfs_file_info_unref (info);
+		gfile = g_file_new_for_uri (file->path);
+		g_file_set_attributes_from_info (gfile, info, G_FILE_QUERY_INFO_NONE, NULL, NULL);
+		g_object_unref (info);
+		g_object_unref (gfile);
 		g_free (local_uri);
 	}
 
Index: src/catalog-png-exporter.c
===================================================================
--- src/catalog-png-exporter.c	(revisão 2333)
+++ src/catalog-png-exporter.c	(cópia de trabalho)
@@ -871,7 +871,7 @@
 
 static void
 copy_current_file_to_destination_done (const char     *uri, 
-				       GnomeVFSResult  result, 
+				       GError         *error, 
 				       gpointer        data)
 {
 	CatalogPngExporter *ce = data;
Index: src/dlg-open-with.c
===================================================================
--- src/dlg-open-with.c	(revisão 2333)
+++ src/dlg-open-with.c	(cópia de trabalho)
@@ -25,8 +25,7 @@
 
 #include <gtk/gtk.h>
 #include <glade/glade.h>
-#include <libgnomevfs/gnome-vfs-mime.h>
-#include <libgnomevfs/gnome-vfs-mime-handlers.h>
+#include <gio/gio.h>
 
 #include "file-utils.h"
 #include "gconf-utils.h"
@@ -68,7 +67,7 @@
 		path_list_free (data->uris);
 
 	if (data->apps != NULL)
-		gnome_vfs_mime_application_list_free (data->apps);
+		g_list_free (data->apps);
 
 	g_free (data);
 }
@@ -83,8 +82,9 @@
 	char        *application;
 	GList       *scan;
 	GSList      *sscan, *editors;
-	GnomeVFSMimeApplication *registered_app = NULL;
+	GAppInfo    *registered_app = NULL;
 	gboolean     present = FALSE;
+	GError      *error = NULL;
 	const char  *command = NULL;
 
 	application_utf8 = gtk_entry_get_text (GTK_ENTRY (data->app_entry));
@@ -93,9 +93,9 @@
 	/* add the command to the editors list if not already present. */
 
 	for (scan = data->apps; scan && ! present; scan = scan->next) {
-		GnomeVFSMimeApplication *app = scan->data;
-		if (strcmp (gnome_vfs_mime_application_get_exec (app), application) == 0) {
-			command = gnome_vfs_mime_application_get_exec (app);
+		GAppInfo *app = scan->data;
+		if (strcmp (g_app_info_get_executable (app), application) == 0) {
+			command = g_app_info_get_executable (app);
 			present = TRUE;
 			registered_app = app;
 		}
@@ -119,7 +119,8 @@
 	/* exec the application. */
 
 	if (registered_app != NULL) {
-		if (gnome_vfs_mime_application_launch (registered_app, data->uris) == GNOME_VFS_OK)
+		g_app_info_launch_uris (registered_app, data->uris, NULL, &error);
+		if (error == NULL)
 			gtk_widget_destroy (data->dialog);
 	} 
 	else if ((command != NULL) && exec_command (command, data->uris))
@@ -137,7 +138,7 @@
 {
 	DialogData              *data = p;
 	GtkTreeIter              iter;
-        GnomeVFSMimeApplication *app;
+        GAppInfo                *app;
 
 	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (data->app_list_tree_view));
 	if (selection == NULL)
@@ -149,7 +150,7 @@
         gtk_tree_model_get (data->app_model, &iter,
                             DATA_COLUMN, &app,
                             -1);
-	_gtk_entry_set_locale_text (GTK_ENTRY (data->app_entry), gnome_vfs_mime_application_get_exec (app));
+	_gtk_entry_set_locale_text (GTK_ENTRY (data->app_entry), g_app_info_get_executable (app));
 }
 
 
@@ -241,7 +242,7 @@
 	DialogData              *data;
 	GList                   *scan;
 	GSList                  *sscan, *editors;
-	GnomeVFSMimeApplication *app;
+	GAppInfo                *app;
 	GList                   *app_names = NULL;
 	GtkWidget               *ok_btn, *cancel_btn;
 	GtkTreeIter              iter;
@@ -325,7 +326,7 @@
 
 		result = get_mime_type (uri);
 		if (result != NULL)
-			data->apps = g_list_concat (data->apps, gnome_vfs_mime_get_all_applications (result));
+			data->apps = g_list_concat (data->apps, g_app_info_get_all_for_type (result));
 	}
 
 	data->app_model = GTK_TREE_MODEL (gtk_list_store_new (N_COLUMNS, 
@@ -341,9 +342,11 @@
 	icon_size = get_folder_pixbuf_size_for_list (GTK_WIDGET (window));
 
 	for (scan = data->apps; scan; scan = scan->next) {
-		gboolean   found;
-		char      *utf8_name;
-		GdkPixbuf *icon;
+		gboolean    found;
+		char        *utf8_name;
+		GThemedIcon *ticon;
+		GStrv       icon_names;
+		GdkPixbuf   *icon;
 
 		app = scan->data;
 
@@ -351,7 +354,7 @@
 		if (app_names != NULL) {
 			GList *p;
 			for (p = app_names; p && !found; p = p->next)
-				if (strcmp ((char*)p->data, gnome_vfs_mime_application_get_exec (app)) == 0)
+				if (strcmp ((char*)p->data, g_app_info_get_executable (app)) == 0)
 					found = TRUE;
 		}
 
@@ -359,22 +362,26 @@
 			continue;
 
 		/* do not include gthumb itself */
-		if (strncmp (gnome_vfs_mime_application_get_exec (app), "gthumb", 6) == 0)
+		if (strncmp (g_app_info_get_executable (app), "gthumb", 6) == 0)
 			continue;
 
-		app_names = g_list_prepend (app_names, (char*)gnome_vfs_mime_application_get_exec (app));
+		app_names = g_list_prepend (app_names, (char*)g_app_info_get_executable (app));
 		
 		gtk_list_store_append (GTK_LIST_STORE (data->app_model),
 				       &iter);
 
-		utf8_name = g_locale_to_utf8 (app->name, -1, NULL, NULL, NULL);
-		icon = create_pixbuf (theme, gnome_vfs_mime_application_get_icon (app), icon_size);
+		utf8_name = g_locale_to_utf8 (g_app_info_get_name (app), -1, NULL, NULL, NULL);
+		ticon = G_THEMED_ICON (g_app_info_get_icon (app));
+		g_object_get (ticon, "names", &icon_names, NULL);
+		icon = create_pixbuf (theme, icon_names[0], icon_size);		
 		gtk_list_store_set (GTK_LIST_STORE (data->app_model), &iter,
 				    ICON_COLUMN, icon,
 				    TEXT_COLUMN, utf8_name,
 				    DATA_COLUMN, app,
 				    -1);
 		g_free (utf8_name);
+		g_free (icon_names);
+		g_object_unref (ticon);
 	}
 
 	column = gtk_tree_view_column_new ();
Index: src/gth-window-actions-callbacks.c
===================================================================
--- src/gth-window-actions-callbacks.c	(revisão 2333)
+++ src/gth-window-actions-callbacks.c	(cópia de trabalho)
@@ -651,15 +651,15 @@
 
 static void 
 set_wallpaper_step_2 (const char     *uri, 
-		      GnomeVFSResult  result, 
+		      GError         *error, 
 		      gpointer        callback_data)
 {
 	SetWallpaperData *data = callback_data;
 	GConfClient      *client;
 	char             *options = "none";
 
-	if (result != GNOME_VFS_OK) {
-		_gtk_error_dialog_run (GTK_WINDOW (data->window), "%s", gnome_vfs_result_to_string (result));
+	if (error) {
+		_gtk_error_dialog_run (GTK_WINDOW (data->window), "%s", error->message);
 		g_free (data);
 		return;
 	}
Index: src/dlg-image-prop.c
===================================================================
--- src/dlg-image-prop.c	(revisão 2333)
+++ src/dlg-image-prop.c	(cópia de trabalho)
@@ -29,8 +29,6 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <gio/gio.h>
-#include <libgnomevfs/gnome-vfs-mime.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
 #include <glade/glade.h>
 
 #include "comments.h"
@@ -377,6 +375,7 @@
 	GthWindow    *window;
 	ImageViewer  *viewer;
 	const char   *image_filename;
+	char         *mime_description;
 	GdkPixbuf    *pixbuf;
 	int           width, height;
 	char         *file_size_txt;
@@ -406,8 +405,10 @@
 		
 		/**/
 		
+		mime_description = g_content_type_get_description (get_mime_type (image_filename));
 		gtk_label_set_text (GTK_LABEL (data->i_type_label),
-				    gnome_vfs_mime_get_description (get_mime_type (image_filename)));
+				    mime_description);
+		g_free (mime_description);
 		
 		/**/
 
Index: src/gth-browser.c
===================================================================
--- src/gth-browser.c	(revisão 2333)
+++ src/gth-browser.c	(cópia de trabalho)
@@ -2137,7 +2137,7 @@
 			return TRUE;
 
 		utf8_name = gth_dir_list_get_name_from_iter (browser->priv->dir_list, &iter);
-		name = gnome_vfs_escape_string (utf8_name);
+		name = g_uri_escape_string (utf8_name, "", TRUE);
 		g_free (utf8_name);
 
 		if (strcmp (name, "..") == 0) {
@@ -2268,7 +2268,7 @@
 		char             *name;
 
 		utf8_name = gth_dir_list_get_name_from_iter (priv->dir_list, &iter);
-		name = gnome_vfs_escape_string (utf8_name);
+		name = g_uri_escape_string (utf8_name, "", TRUE);
 		g_free (utf8_name);
 
 		if (strcmp (name, "..") == 0) {
@@ -2543,7 +2543,7 @@
 		char             *name;
 
 		utf8_name = catalog_list_get_name_from_iter (priv->catalog_list, &iter);
-		name = gnome_vfs_escape_string (utf8_name);
+		name = g_uri_escape_string (utf8_name, "", TRUE);
 		g_free (utf8_name);
 
 		if (strcmp (name, "..") == 0) {
@@ -2855,6 +2855,7 @@
 	GList	   *video_list = NULL;
 	GList	   *scan;
 	GList      *selection;
+	GError     *error = NULL;
 
 	if (browser->priv->image == NULL)
 		return FALSE;
@@ -3243,7 +3244,7 @@
 				return FALSE;
 
 			utf8_name = catalog_list_get_name_from_iter (priv->catalog_list, &iter);
-			name = gnome_vfs_escape_string (utf8_name);
+			name = g_uri_escape_string (utf8_name, "", TRUE);
 			g_free (utf8_name);
 
 			if (strcmp (name, "..") == 0)
@@ -3279,7 +3280,7 @@
 				return FALSE;
 
 			utf8_name = gth_dir_list_get_name_from_iter (priv->dir_list, &iter);
-			name = gnome_vfs_escape_string (utf8_name);
+			name = g_uri_escape_string (utf8_name, "", TRUE);
 			g_free (utf8_name);
 
 			if (strcmp (name, "..") == 0)
@@ -3497,7 +3498,7 @@
 	catalog_name_utf8 = g_strconcat (_("Dragged Images"),
 					 CATALOG_EXT,
 					 NULL);
-	catalog_name = gnome_vfs_escape_string (catalog_name_utf8);
+	catalog_name = g_uri_escape_string (catalog_name_utf8, "", TRUE);
 	catalog_path = get_catalog_full_path (catalog_name);
 	g_free (catalog_name);
 	g_free (catalog_name_utf8);
Index: src/dlg-jpegtran.c
===================================================================
--- src/dlg-jpegtran.c	(revisão 2333)
+++ src/dlg-jpegtran.c	(cópia de trabalho)
@@ -27,6 +27,7 @@
 #include <unistd.h>
 
 #include <glib/gi18n.h>
+#include <gio/gio.h>
 #include <gtk/gtk.h>
 #include <libgnome/gnome-help.h>
 #include <libgnomevfs/gnome-vfs-ops.h>
@@ -215,7 +216,7 @@
 	GtkWidget        *parent_window;
 	DialogData       *data;
 	GList            *current_image;
-	GnomeVFSFileInfo *info;
+	GFileInfo        *info;
 	gboolean          notify_soon;
 	CopyDoneFunc      done_func;
 	gpointer          done_data;
@@ -239,26 +240,28 @@
 
 static void
 apply_transformation_done (const char     *uri,
-			   GnomeVFSResult  result,
+			   GError         *error,
 		           gpointer        callback_data)
 {
 	ApplyTransformData *at_data = callback_data;
 	FileData           *file = at_data->current_image->data;
+	GFile              *gfile = g_file_new_for_uri (file->path);
 		
-	if (result == GNOME_VFS_OK) {
+	if (error == NULL) {
 		if (at_data->info != NULL)
-			gnome_vfs_set_file_info (file->path, at_data->info, GNOME_VFS_SET_FILE_INFO_PERMISSIONS | GNOME_VFS_SET_FILE_INFO_OWNER);
+			g_file_set_attributes_from_info (gfile, at_data->info, G_FILE_QUERY_INFO_NONE, NULL, NULL);
 		notify_file_changed (at_data->data, file->path, at_data->notify_soon);
 	}
 	else 
 		_gtk_error_dialog_run (GTK_WINDOW (at_data->data->dialog), _("Could not move temporary file to remote location. Check remote permissions."));
 	
 	if (at_data->done_func)
-		(at_data->done_func) (uri, result, at_data->done_data);
+		(at_data->done_func) (uri, error, at_data->done_data);
 
 	if (at_data->info != NULL)
-		gnome_vfs_file_info_unref (at_data->info);
+		g_object_unref (at_data->info);
 	g_free (at_data);
+	g_object_unref (gfile);
 }
 
 
@@ -286,7 +289,7 @@
 
 static void
 apply_transformation__step2 (const char     *uri,
-			     GnomeVFSResult  result,
+			     GError         *error,
 		             gpointer        callback_data)
 {
 	ApplyTransformData *at_data = callback_data;
@@ -337,8 +340,10 @@
 		      CopyDoneFunc  done_func,
 		      gpointer      done_data)
 {
+        GFile              *gfile;
 	FileData           *file = current_image->data;
 	ApplyTransformData *at_data;
+        GError             *error = NULL;
 
 	at_data = g_new0 (ApplyTransformData, 1);
 	at_data->parent_window = parent_window;
@@ -347,9 +352,12 @@
 	at_data->notify_soon = notify_soon;
 	at_data->done_func = done_func;
 	at_data->done_data = done_data;
-	at_data->info = gnome_vfs_file_info_new ();
-	if (gnome_vfs_get_file_info (file->path, at_data->info, GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS|GNOME_VFS_FILE_INFO_FOLLOW_LINKS) != GNOME_VFS_OK) {
-		gnome_vfs_file_info_unref (at_data->info);
+
+	gfile = g_file_new_for_uri (file->path);
+	at_data->info = g_file_query_info (gfile, "owner::*,access::*,standard::size", G_FILE_QUERY_INFO_NONE, NULL, &error);
+	g_object_unref (gfile);
+	if (error) {
+		g_object_unref (at_data->info);
 		at_data->info = NULL;
 	}
 
@@ -374,7 +382,7 @@
 
 static void
 apply_transformation_to_all_continue (const char     *uri,
-				      GnomeVFSResult  result,
+				      GError         *error,
 				      gpointer        data)
 {
 	BatchTransformation *bt_data = data;
@@ -472,7 +480,7 @@
 
 static void
 load_next_image_after_transformation (const char     *uri,
-				      GnomeVFSResult  result,
+				      GError         *error,
 				      gpointer        callback_data)
 {
 	DialogData *data = callback_data;
Index: src/dlg-reset-exif.c
===================================================================
--- src/dlg-reset-exif.c	(revisão 2333)
+++ src/dlg-reset-exif.c	(cópia de trabalho)
@@ -1,5 +1,4 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
 /*
  *  GThumb
  *
@@ -28,6 +27,7 @@
 
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
+#include <gio/gio.h>
 #include <libgnome/gnome-help.h>
 #include <libgnomevfs/gnome-vfs-ops.h>
 #include <glade/glade.h>
@@ -89,7 +89,7 @@
 typedef struct {
 	DialogData       *data;
 	GList            *current_image;
-	GnomeVFSFileInfo *info;
+	GFileInfo        *info;
 	gboolean          notify_soon;
 	CopyDoneFunc      done_func;
 	gpointer          done_data;
@@ -113,32 +113,34 @@
 
 static void
 apply_transformation_done (const char     *uri,
-			   GnomeVFSResult  result,
+			   GError         *error,
 		           gpointer        callback_data)
 {
 	ApplyTransformData *at_data = callback_data;
 	FileData           *file = at_data->current_image->data;
+	GFile              *gfile = g_file_new_for_uri (file->path);
 		
-	if (result == GNOME_VFS_OK) {
+	if (error == NULL) {
 		if (at_data->info != NULL)
-			gnome_vfs_set_file_info (file->path, at_data->info, GNOME_VFS_SET_FILE_INFO_PERMISSIONS | GNOME_VFS_SET_FILE_INFO_OWNER);
+			g_file_set_attributes_from_info (gfile, at_data->info, G_FILE_QUERY_INFO_NONE, NULL, NULL);
 		notify_file_changed (at_data->data, file->path, at_data->notify_soon);
 	}
 	else 
 		_gtk_error_dialog_run (GTK_WINDOW (at_data->data->window), _("Could not move temporary file to remote location. Check remote permissions."));
 	
 	if (at_data->done_func)
-		(at_data->done_func) (uri, result, at_data->done_data);
+		(at_data->done_func) (uri, error, at_data->done_data);
 
 	if (at_data->info != NULL)
-		gnome_vfs_file_info_unref (at_data->info);
+		g_object_unref (at_data->info);
 	g_free (at_data);
+	g_object_unref (gfile);
 }
 
 
 static void
 apply_transformation__step2 (const char     *uri,
-			     GnomeVFSResult  result,
+			     GError         *error,
 		             gpointer        callback_data)
 {
 	ApplyTransformData *at_data = callback_data;
@@ -160,6 +162,8 @@
 		      CopyDoneFunc  done_func,
 		      gpointer      done_data)
 {
+	GFile              *gfile;
+	GError             *error = NULL;
 	FileData           *file = current_image->data;
 	ApplyTransformData *at_data;
 
@@ -169,9 +173,11 @@
 	at_data->notify_soon = notify_soon;
 	at_data->done_func = done_func;
 	at_data->done_data = done_data;
-	at_data->info = gnome_vfs_file_info_new ();
-	if (gnome_vfs_get_file_info (file->path, at_data->info, GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS|GNOME_VFS_FILE_INFO_FOLLOW_LINKS) != GNOME_VFS_OK) {
-		gnome_vfs_file_info_unref (at_data->info);
+	gfile = g_file_new_for_uri (file->path);
+	at_data->info = g_file_query_info (gfile, "owner::*,access::*,standard::size", G_FILE_QUERY_INFO_NONE, NULL, &error);
+	g_object_unref (gfile);
+	if (error) {
+		g_object_unref (at_data->info);
 		at_data->info = NULL;
 	}
 
@@ -196,7 +202,7 @@
 
 static void
 apply_transformation_to_all_continue (const char     *uri,
-				      GnomeVFSResult result,
+				      GError         *error,
 				      gpointer       data)
 {
 	BatchTransformation *bt_data = data;
Index: src/gth-viewer.c
===================================================================
--- src/gth-viewer.c	(revisão 2333)
+++ src/gth-viewer.c	(cópia de trabalho)
@@ -28,8 +28,6 @@
 #include <gtk/gtk.h>
 #include <glade/glade.h>
 #include <gio/gio.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-#include <libgnomevfs/gnome-vfs-mime.h>
 
 #include "jpegutils/jpeg-data.h"
 #include "comments.h"
@@ -711,7 +709,7 @@
 				 gpointer     user_data)
 {
 	GthViewer               *viewer = user_data;
-	GnomeVFSMimeApplication *app;
+	GAppInfo                *app;
 	GList                   *uris;
 
 	if (viewer->priv->image == NULL)
@@ -719,11 +717,10 @@
 
 	app = g_object_get_data (G_OBJECT (menuitem), "app");
 	uris = g_list_prepend (NULL, viewer->priv->image->path);
-	gnome_vfs_mime_application_launch (app, uris);
+	g_app_info_launch_uris (app, uris, NULL, NULL);
 	g_list_free (uris);
 }
 
-
 static void
 viewer_update_open_with_menu (GthViewer *viewer)
 {
@@ -742,26 +739,35 @@
 		mime_type = priv->image->mime_type;
 
 	if (mime_type != NULL) {
-		GList        *apps = gnome_vfs_mime_get_all_applications (mime_type);
+		GList        *apps = g_app_info_get_all_for_type (mime_type);
 		GtkIconTheme *theme = gtk_icon_theme_get_default ();
 		int           icon_size = get_folder_pixbuf_size_for_list (GTK_WIDGET (viewer));
 
 		for (scan = apps; scan; scan = scan->next) {
-			GnomeVFSMimeApplication *app = scan->data;
+			GAppInfo                *app = scan->data;
 			GtkWidget               *mitem;
+			GThemedIcon             *icon;
+			GStrv                   icon_names;
 
 			/* do not include gthumb itself */
-			if (strncmp (gnome_vfs_mime_application_get_exec (app), "gthumb", 6) == 0)
+			if (strncmp (g_app_info_get_executable (app), "gthumb", 6) == 0)
 				continue;
 
-			mitem = gtk_image_menu_item_new_with_label (gnome_vfs_mime_application_get_name (app));
-			gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mitem), create_image (theme, gnome_vfs_mime_application_get_icon (app), icon_size));
-			g_object_set_data_full (G_OBJECT (mitem), "app", app, (GDestroyNotify)gnome_vfs_mime_application_free);
+			mitem = gtk_image_menu_item_new_with_label (g_app_info_get_name (app));
+			icon = G_THEMED_ICON(g_app_info_get_icon (app));
+			g_object_get(icon, "names", &icon_names, NULL);
+
+			gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mitem), create_image (theme, icon_names[0], icon_size));
+			g_object_set_data (G_OBJECT (mitem), "app", app);
 			g_signal_connect (mitem, "activate",
 					  G_CALLBACK (open_with_menu_item_activate_cb),
 					  viewer);
 			gtk_widget_show_all (mitem);
 			gtk_menu_insert (priv->open_with_popup_menu, mitem, pos++);
+
+			g_object_unref (icon);
+			if (icon_names)
+				g_free (icon_names);
 		}
 		g_list_free (apps);
 	} 
Index: libgthumb/file-utils.c
===================================================================
--- libgthumb/file-utils.c	(revisão 2333)
+++ libgthumb/file-utils.c	(cópia de trabalho)
@@ -2531,6 +2531,7 @@
 struct _CopyData {
         char                *source_uri;
         char                *target_uri;
+        GError              *error;
         GnomeVFSResult       result;
         GnomeVFSAsyncHandle *handle;
         CopyDoneFunc         done_func;
@@ -2554,6 +2555,7 @@
 	copy_data->done_data = done_data;
 	copy_data->result = GNOME_VFS_OK;
 	copy_data->idle_id = 0;
+	copy_data->error = NULL;
 	
 	return copy_data;
 }
@@ -2593,7 +2595,7 @@
 	
 	if (copy_data->done_func != NULL) {
 		copy_data->handle = NULL;	
-		(copy_data->done_func) (copy_data->target_uri, copy_data->result, copy_data->done_data);
+		(copy_data->done_func) (copy_data->target_uri, copy_data->error, copy_data->done_data);
 	}
 	copy_data_free (copy_data);
 	
@@ -2996,7 +2998,8 @@
 	}
 	
 	if (data->done_func != NULL)
-		data->done_func (uri, result, data->done_data);
+                /*FIXME: change GnomeVFSResult to GError and use below instead of NULL*/
+		data->done_func (uri, NULL, data->done_data);
 	
 	g_free (data);
 }
Index: libgthumb/file-utils.h
===================================================================
--- libgthumb/file-utils.h	(revisão 2333)
+++ libgthumb/file-utils.h	(cópia de trabalho)
@@ -39,7 +39,7 @@
 #define SPECIAL_DIR(x) (! strcmp (x, "..") || ! strcmp (x, "."))
 #define errno_to_string() (gnome_vfs_result_to_string (gnome_vfs_result_from_errno ()))
 
-typedef void (*CopyDoneFunc) (const char *, GnomeVFSResult, gpointer);
+typedef void (*CopyDoneFunc) (const char *, GError *, gpointer);
 
 /* Async directory list */
 
