Tomas Bzatek e9af852
Not all gphoto drivers implement get storage info (drivers for proprietary
Tomas Bzatek e9af852
protocols often don't). This patch fixes the gphoto2volumemonitor to still
Tomas Bzatek e9af852
recognize cams which gphoto driver does not implement get storage info.
Tomas Bzatek e9af852
Tomas Bzatek e9af852
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Tomas Bzatek e9af852
diff -up gvfs-1.5.1/monitor/gphoto2/ggphoto2volumemonitor.c~ gvfs-1.5.1/monitor/gphoto2/ggphoto2volumemonitor.c
Tomas Bzatek e9af852
--- gvfs-1.5.1/monitor/gphoto2/ggphoto2volumemonitor.c~	2009-11-18 13:14:51.000000000 +0100
Tomas Bzatek e9af852
+++ gvfs-1.5.1/monitor/gphoto2/ggphoto2volumemonitor.c	2010-01-06 11:46:16.000000000 +0100
Tomas Bzatek e9af852
@@ -605,7 +605,7 @@ get_stores_for_camera (int bus_num, int 
Tomas Bzatek e9af852
   GPContext *context;
Tomas Bzatek e9af852
   GPPortInfo info;
Tomas Bzatek e9af852
   GPPortInfoList *il;
Tomas Bzatek e9af852
-  int num_storage_info, n;
Tomas Bzatek e9af852
+  int num_storage_info, n, rc;
Tomas Bzatek e9af852
   Camera *camera;
Tomas Bzatek e9af852
   char *port;
Tomas Bzatek e9af852
   guint i;
Tomas Bzatek e9af852
@@ -637,8 +637,14 @@ get_stores_for_camera (int bus_num, int 
Tomas Bzatek e9af852
     goto out;
Tomas Bzatek e9af852
 
Tomas Bzatek e9af852
   /* Get information about the storage heads */
Tomas Bzatek e9af852
-  if (gp_camera_get_storageinfo (camera, &storage_info, &num_storage_info, context) != 0)
Tomas Bzatek e9af852
+  rc = gp_camera_get_storageinfo (camera, &storage_info, &num_storage_info, context);
Tomas Bzatek e9af852
+  if (rc != 0) {
Tomas Bzatek e9af852
+    /* Not all gphoto drivers implement get storage info (drivers for proprietary
Tomas Bzatek e9af852
+       protocols often don't) */
Tomas Bzatek e9af852
+    if (rc == GP_ERROR_NOT_SUPPORTED)
Tomas Bzatek e9af852
+      l = g_list_prepend (l, g_strdup ("/"));
Tomas Bzatek e9af852
     goto out;
Tomas Bzatek e9af852
+  }
Tomas Bzatek e9af852
 
Tomas Bzatek e9af852
   /* Append the data to the list */
Tomas Bzatek e9af852
   for (i = 0; i < num_storage_info; i++)