summaryrefslogtreecommitdiff
path: root/libgphoto2/gphoto2-abilities-list.c
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2008-03-15 21:45:48 +0000
committerMarcus Meissner <marcus@jet.franken.de>2008-03-15 21:45:48 +0000
commit3c26841fa08d4f7c82ea7b4004a954f6fe146f17 (patch)
tree77e49b5d592507d3aa7e03ef5117c4dcd5850e5e /libgphoto2/gphoto2-abilities-list.c
parentf50fb2ec5e87a8538befd8909ae6243711d49baa (diff)
downloadlibgphoto2-3c26841fa08d4f7c82ea7b4004a954f6fe146f17.tar.gz
GPPortInfo struct abstracted into a private struct.
- libgphoto2_port rewritten for new GPPortInfo. - camlibs/directory and camlibs/ptp2 adjusted. - libgphoto2/ adjusted for the changed GPPortInfo list handling. - configure.ac adjusted, NEWS adjusted git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10990 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2/gphoto2-abilities-list.c')
-rw-r--r--libgphoto2/gphoto2-abilities-list.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/libgphoto2/gphoto2-abilities-list.c b/libgphoto2/gphoto2-abilities-list.c
index 309f099fa..f6a1677c4 100644
--- a/libgphoto2/gphoto2-abilities-list.c
+++ b/libgphoto2/gphoto2-abilities-list.c
@@ -430,17 +430,24 @@ gp_abilities_list_detect (CameraAbilitiesList *list,
CHECK_RESULT (gp_port_new (&port));
for (i = 0; i < info_count; i++) {
int res;
+ char *xpath;
+ GPPortType type;
CHECK_RESULT (gp_port_info_list_get_info (info_list, i, &info));
CHECK_RESULT (gp_port_set_info (port, info));
- switch (info.type) {
+ gp_port_info_get_type (info, &type);
+ res = gp_port_info_get_path (info, &xpath);
+ if (res <GP_OK)
+ continue;
+ switch (type) {
case GP_PORT_USB: {
int ability;
+
res = gp_abilities_list_detect_usb (list, &ability, port);
if (res == GP_OK) {
gp_list_append(l,
list->abilities[ability].model,
- info.path);
+ xpath);
} else if (res < 0)
gp_port_set_error (port, NULL);
@@ -450,7 +457,7 @@ gp_abilities_list_detect (CameraAbilitiesList *list,
char *s, path[1024];
struct stat stbuf;
- s = strchr (info.path, ':');
+ s = strchr (xpath, ':');
if (!s)
break;
s++;
@@ -460,17 +467,17 @@ gp_abilities_list_detect (CameraAbilitiesList *list,
if (-1 == stat(path, &stbuf))
continue;
}
- gp_list_append (l, "Mass Storage Camera", info.path);
+ gp_list_append (l, "Mass Storage Camera", xpath);
break;
}
case GP_PORT_PTPIP: {
char *s;
- s = strchr (info.path, ':');
+ s = strchr (xpath, ':');
if (!s) break;
s++;
if (!strlen(s)) break;
- gp_list_append (l, "PTP/IP Camera", info.path);
+ gp_list_append (l, "PTP/IP Camera", xpath);
break;
}
default: