[gvfs] gphoto2: Recognize cameras which don't implement get storageinfo
- From: Tomas Bzatek <tbzatek src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] gphoto2: Recognize cameras which don't implement get storageinfo
- Date: Tue, 26 Apr 2011 14:36:25 +0000 (UTC)
commit 25b918f1f593f835be7fc74b2afd45c3336e82a1
Author: Hans de Goede <hdegoede redhat com>
Date: Tue Apr 26 16:35:21 2011 +0200
gphoto2: Recognize cameras which don't implement get storageinfo
Not all gphoto drivers implement get storage info (drivers for proprietary
protocols often don't). This patch fixes the gphoto2volumemonitor to still
recognize cams which gphoto driver does not implement get storage info.
https://bugzilla.gnome.org/show_bug.cgi?id=606059
Signed-off-by: Hans de Goede <hdegoede redhat com>
Signed-off-by: Tomas Bzatek <tbzatek redhat com>
monitor/gphoto2/ggphoto2volumemonitor.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/monitor/gphoto2/ggphoto2volumemonitor.c b/monitor/gphoto2/ggphoto2volumemonitor.c
index 6c26e00..b9b38b4 100644
--- a/monitor/gphoto2/ggphoto2volumemonitor.c
+++ b/monitor/gphoto2/ggphoto2volumemonitor.c
@@ -606,7 +606,7 @@ get_stores_for_camera (const char *bus_num, const char *device_num)
GPContext *context;
GPPortInfo info;
GPPortInfoList *il;
- int num_storage_info, n;
+ int num_storage_info, n, rc;
Camera *camera;
char *port;
guint i;
@@ -638,8 +638,14 @@ get_stores_for_camera (const char *bus_num, const char *device_num)
goto out;
/* Get information about the storage heads */
- if (gp_camera_get_storageinfo (camera, &storage_info, &num_storage_info, context) != 0)
+ rc = gp_camera_get_storageinfo (camera, &storage_info, &num_storage_info, context);
+ if (rc != 0) {
+ /* Not all gphoto drivers implement get storage info (drivers for proprietary
+ protocols often don't) */
+ if (rc == GP_ERROR_NOT_SUPPORTED)
+ l = g_list_prepend (l, g_strdup ("/"));
goto out;
+ }
/* Append the data to the list */
for (i = 0; i < num_storage_info; i++)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]