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:
@@ -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.
|
||||
|
||||
@@ -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 = ¶ms->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");
|
||||
|
||||
Reference in New Issue
Block a user