gvfs r2319 - in trunk: . daemon



Author: alexl
Date: Thu Mar 12 12:26:55 2009
New Revision: 2319
URL: http://svn.gnome.org/viewvc/gvfs?rev=2319&view=rev

Log:
2009-03-12  Alexander Larsson  <alexl redhat com>

        * daemon/gvfsbackendgphoto2.c:
        (ensure_ignore_prefix):
	Make sure we ignore broken stores the same way we do in the
	volume monitor.



Modified:
   trunk/ChangeLog
   trunk/daemon/gvfsbackendgphoto2.c

Modified: trunk/daemon/gvfsbackendgphoto2.c
==============================================================================
--- trunk/daemon/gvfsbackendgphoto2.c	(original)
+++ trunk/daemon/gvfsbackendgphoto2.c	Thu Mar 12 12:26:55 2009
@@ -1310,8 +1310,8 @@
 ensure_ignore_prefix (GVfsBackendGphoto2 *gphoto2_backend, GVfsJob *job)
 {
   gchar *prefix;
-  CameraStorageInformation *storage_info;
-  int num_storage_info;
+  CameraStorageInformation *storage_info, *head;
+  int num_storage_info, i;
 
   /* already set */
   if (gphoto2_backend->ignore_prefix != NULL)
@@ -1325,10 +1325,22 @@
                                  gphoto2_backend->context) != 0)
     goto out;
 
-  if (num_storage_info > 1)
-    goto out;
+  head = NULL;
+  for (i = 0; i < num_storage_info; i++)
+    {
+      /* Ignore storage with no capacity (see bug 570888) */
+      if ((storage_info[i].fields & GP_STORAGEINFO_MAXCAPACITY) &&
+          storage_info[i].capacitykbytes == 0)
+        continue;
+      
+      /* Multiple heads, don't ignore */
+      if (head != NULL)
+	goto out;
+	
+      head = &storage_info[i];
+    }
 
-  prefix = g_strdup_printf ("%s/", storage_info[0].basedir);
+  prefix = g_strdup_printf ("%s/", head->basedir);
 
  out:
 



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