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



commit 01088eac7adca5344c510ccdd03b7393733050c6
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 a785a55..da5dc94 100644
--- a/applet/main.c
+++ b/applet/main.c
@@ -113,9 +113,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]