handle cases where we just have objects, but no root object

or no DCIM directory.

attach all those objects to /


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9130 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Marcus Meissner
2006-08-31 07:05:31 +00:00
parent c97a39978f
commit 9ea2b89fde
2 changed files with 23 additions and 0 deletions

View File

@@ -1,3 +1,8 @@
2006-08-31 Marcus Meissner <marcus@jet.franken.de>
* library.c: Handle cameras which just have files, but no
directory or root object. Kodak EasyShare C330 for instance.
2006-08-30 Marcus Meissner <marcus@jet.franken.de>
* library.c: Added iRiver Clix.

View File

@@ -3241,9 +3241,27 @@ fallback:
GP_DEBUG("Changing DCIM ParentObject ID from 0x%x to 0",
oi->ParentObject);
oi->ParentObject = 0;
nroot++;
}
}
}
/* Some cameras do not have a directory at all, just files or unattached
* directories. In this case associate all unattached to the 0 object.
*/
if (nroot == 0) {
/* look for entries with parentobjects that do not exist */
for (i = 0; i < params->handles.n; i++)
{
int j;
PTPObjectInfo *oi = &params->objectinfo[i];
for (j = 0;j < params->handles.n; j++)
if (oi->ParentObject == params->handles.Handler[j])
break;
if (j == params->handles.n)
oi->ParentObject = 0;
}
}
}
#if 0
add_dir (camera, 0x00000000, 0xff000000, "DIR1");