[gnome-bluetooth/gnome-2-28] Don't fail to browse the device if already mounted



commit 56924614be5372a8131488fd39e3be1abcba8f04
Author: Bastien Nocera <hadess hadess net>
Date:   Wed May 26 15:24:15 2010 +0100

    Don't fail to browse the device if already mounted
    
    We don't need to have an error if the device is already mounted,
    just show it already!

 applet/main.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/applet/main.c b/applet/main.c
index cb17ebe..090e747 100644
--- a/applet/main.c
+++ b/applet/main.c
@@ -110,9 +110,16 @@ mount_finish_cb (GObject *source_object,
 
 	if (g_file_mount_enclosing_volume_finish (G_FILE (source_object),
 						  res, &error) == FALSE) {
-		g_printerr ("Failed to mount OBEX volume: %s", error->message);
-		g_error_free (error);
-		return;
+		/* Ignore "already mounted" error */
+		if (error->domain == G_IO_ERROR &&
+		    error->code == G_IO_ERROR_ALREADY_MOUNTED) {
+			g_error_free (error);
+			error = NULL;
+		} else {
+			g_printerr ("Failed to mount OBEX volume: %s", error->message);
+			g_error_free (error);
+			return;
+		}
 	}
 
 	uri = g_file_get_uri (G_FILE (source_object));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]