[maemo-commits] [maemo-commits] r13872 - projects/haf/trunk/hildon-fm/hildon-fm

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon Sep 17 21:11:14 EEST 2007
Author: marivoll
Date: 2007-09-17 21:11:10 +0300 (Mon, 17 Sep 2007)
New Revision: 13872

Modified:
   projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-voldev.c
Log:
        * hildon-fm/hildon-file-system-voldev.c
	(hildon_file_system_voldev_is_visible): check whether the MMC card
	corresponding to the drive is corrupted to manage drives
	visibility (N66733).


Modified: projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-voldev.c
===================================================================
--- projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-voldev.c	2007-09-17 17:55:17 UTC (rev 13871)
+++ projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-voldev.c	2007-09-17 18:11:10 UTC (rev 13872)
@@ -34,6 +34,8 @@
 #define GCONF_PATH "/system/osso/af"
 #define USED_OVER_USB_KEY GCONF_PATH "/mmc-used-over-usb"
 #define USED_OVER_USB_INTERNAL_KEY GCONF_PATH "/internal-mmc-used-over-usb"
+#define CORRUPTED_MMC_KEY GCONF_PATH "/mmc-corrupted"
+#define CORRUPTED_INTERNAL_MMC_KEY GCONF_PATH "/internal-mmc-corrupted"
 
 static void
 hildon_file_system_voldev_class_init (HildonFileSystemVoldevClass *klass);
@@ -164,19 +166,23 @@
           HILDON_FILE_SYSTEM_VOLDEV_GET_CLASS (voldev);
   gboolean visible = FALSE;
   GError *error = NULL;
-  gboolean value;
+  gboolean value, corrupted;
 
   if (!voldev->vol_type_valid)
     init_vol_type (location->basepath, voldev);
 
-  if (voldev->vol_type == INT_CARD)
+  if (voldev->vol_type == INT_CARD) {
     value = gconf_client_get_bool (klass->gconf,
                                    USED_OVER_USB_INTERNAL_KEY, &error);
-  else if (voldev->vol_type == EXT_CARD)
+    corrupted = gconf_client_get_bool (klass->gconf,
+				       CORRUPTED_INTERNAL_MMC_KEY, &error);
+  } else if (voldev->vol_type == EXT_CARD) {
     value = gconf_client_get_bool (klass->gconf,
                                    USED_OVER_USB_KEY, &error);
-  else
-    value = FALSE; /* USB_STORAGE */
+    corrupted = gconf_client_get_bool (klass->gconf,
+				       CORRUPTED_MMC_KEY, &error);
+  } else
+    value = corrupted = FALSE; /* USB_STORAGE */
 
   if (error)
     {
@@ -195,7 +201,8 @@
     visible = FALSE; /* USB drives are never visible */
   else if (voldev->drive && !voldev->used_over_usb)
     visible = (gnome_vfs_drive_is_connected (voldev->drive)
-	       && !gnome_vfs_drive_is_mounted (voldev->drive));
+	       && !gnome_vfs_drive_is_mounted (voldev->drive)
+	       && corrupted);
 
   return visible;
 }


More information about the maemo-commits mailing list