[Xfce4-commits] <gigolo:master> Don't show errors we are not supposed to show

Enrico Tröger noreply at xfce.org
Sun Jan 9 11:54:01 CET 2011


Updating branch refs/heads/master
         to 9de1c447ab7dfa22c76c96d198dc97fa2cf76f41 (commit)
       from 520ef33f1717426e4bcf158c94ec732bff445463 (commit)

commit 9de1c447ab7dfa22c76c96d198dc97fa2cf76f41
Author: Enrico Tröger <enrico at xfce.org>
Date:   Sun Jan 9 11:52:47 2011 +0100

    Don't show errors we are not supposed to show

 src/backendgvfs.c |   70 ++++++++++++++++++++++++++++------------------------
 1 files changed, 38 insertions(+), 32 deletions(-)

diff --git a/src/backendgvfs.c b/src/backendgvfs.c
index 44b619d..303ed9d 100644
--- a/src/backendgvfs.c
+++ b/src/backendgvfs.c
@@ -430,26 +430,29 @@ static void volume_mount_finished_cb(GObject *src, GAsyncResult *res, gpointer b
 
 	if (! g_volume_mount_finish(G_VOLUME(src), res, &error))
 	{
-		gchar *name, *msg;
-
-		if (G_IS_VOLUME(src))
-			name = g_volume_get_name(G_VOLUME(src));
-		else
-		{
-			gigolo_backend_gvfs_get_name_and_uri_from_mount(G_MOUNT(src), &name, NULL);
-			if (name == NULL)
-				name = g_strdup(_("unknown"));
-		}
-
-		g_warning("Mounting of \"%s\" failed: %s", name, error->message);
 		if (! g_error_matches(error, G_IO_ERROR, G_IO_ERROR_FAILED_HANDLED))
 		{
-			msg = g_strdup_printf(_("Connecting to \"%s\" failed."), name);
-			g_signal_emit(backend, signals[OPERATION_FAILED], 0, msg, error->message);
-			g_free(msg);
+			gchar *name, *msg;
+
+			if (G_IS_VOLUME(src))
+				name = g_volume_get_name(G_VOLUME(src));
+			else
+			{
+				gigolo_backend_gvfs_get_name_and_uri_from_mount(G_MOUNT(src), &name, NULL);
+				if (name == NULL)
+					name = g_strdup(_("unknown"));
+			}
+
+			g_warning("Mounting of \"%s\" failed: %s", name, error->message);
+			if (! g_error_matches(error, G_IO_ERROR, G_IO_ERROR_FAILED_HANDLED))
+			{
+				msg = g_strdup_printf(_("Connecting to \"%s\" failed."), name);
+				g_signal_emit(backend, signals[OPERATION_FAILED], 0, msg, error->message);
+				g_free(msg);
+			}
+			g_error_free(error);
+			g_free(name);
 		}
-		g_error_free(error);
-		g_free(name);
 	}
 	else
 		verbose("Mount finished sucessfully");
@@ -466,25 +469,28 @@ static void unmount_finished_cb(GObject *src, GAsyncResult *res, gpointer backen
 	if (! g_mount_unmount_finish(G_MOUNT(src), res, &error))
 #endif
 	{
-		gchar *name, *msg;
-
-		if (G_IS_VOLUME(src))
-			name = g_volume_get_name(G_VOLUME(src));
-		else
+		if (! g_error_matches(error, G_IO_ERROR, G_IO_ERROR_FAILED_HANDLED))
 		{
-			gigolo_backend_gvfs_get_name_and_uri_from_mount(G_MOUNT(src), &name, NULL);
-			if (name == NULL)
-				name = g_strdup(_("unknown"));
-		}
+			gchar *name, *msg;
 
-		g_warning("Unmounting of \"%s\" failed: %s", name, error->message);
-		msg = g_strdup_printf(_("Disconnecting from \"%s\" failed."), name);
+			if (G_IS_VOLUME(src))
+				name = g_volume_get_name(G_VOLUME(src));
+			else
+			{
+				gigolo_backend_gvfs_get_name_and_uri_from_mount(G_MOUNT(src), &name, NULL);
+				if (name == NULL)
+					name = g_strdup(_("unknown"));
+			}
 
-		g_signal_emit(backend, signals[OPERATION_FAILED], 0, msg, error->message);
+			g_warning("Unmounting of \"%s\" failed: %s", name, error->message);
+			msg = g_strdup_printf(_("Disconnecting from \"%s\" failed."), name);
 
-		g_error_free(error);
-		g_free(name);
-		g_free(msg);
+			g_signal_emit(backend, signals[OPERATION_FAILED], 0, msg, error->message);
+
+			g_error_free(error);
+			g_free(name);
+			g_free(msg);
+		}
 	}
 }
 



More information about the Xfce4-commits mailing list