# --- T2-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # T2 SDE: package/.../vdr-digicam/gphoto-list.patch # Copyright (C) 2008 - 2009 The T2 SDE Project # # More information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # --- T2-COPYRIGHT-NOTE-END --- --- digicam-1.0.2/cameralist.c.orig 2006-09-28 12:41:53.000000000 +0200 +++ digicam-1.0.2/cameralist.c 2007-02-11 21:09:49.000000000 +0100 @@ -47,7 +47,7 @@ // check pre processor option to disable real scan and produce sample entries #ifndef SAMPLE_DIRS // libgphoto2 struct for folder/file list - CameraList result; + CameraList *result; if (!digitalCamera.isAvailable()) return true; @@ -56,19 +56,22 @@ digitalCamera.setDirectory( src->BaseDir(), subdir ); // what scan type ? + gp_list_new(&result); switch (type) { case stDir: // Scan for directories - digitalCamera.getFolderList( &result ); + digitalCamera.getFolderList( result ); break; case stFile: // Scan for files - digitalCamera.getFileList( &result ); + digitalCamera.getFileList( result ); break; } // Display item for each result entry - for (int i=0; icount = 0; // when error occurs + gp_list_unref(list); if (camera != NULL && list != NULL) { lastError = gp_camera_folder_list_folders( camera, cameraDirectory, list, NULL); @@ -140,7 +140,7 @@ // Fill the passed structure with filelist of current directory int DigitalCamera::getFileList(CameraList *list) { if (list != NULL) // init result count to avoid conflicts - list->count = 0; // when error occurs + gp_list_unref(list); if (camera != NULL && list != NULL) { lastError = gp_camera_folder_list_files( camera, cameraDirectory, list, NULL); --- digicam-1.0.2/directory-loader.c.orig 2007-02-11 21:10:03.000000000 +0100 +++ digicam-1.0.2/directory-loader.c 2007-02-11 21:13:20.000000000 +0100 @@ -31,10 +31,10 @@ } void cDirectoryLoader::Download(void) { - CameraList files; - files.count = 0; + CameraList *files; CameraFile *file = NULL; char buf[FACTSHEET_BUFLEN]; + const char *name; #ifdef DEBUG printf("cDirectoryLoader::Download\n" ); @@ -47,24 +47,24 @@ #endif dCam->setDirectory( "/", PathOnCamera ); // Get filelist - if (dCam->getFileList( &files ) == DIGICAM_NO_ERROR) { + gp_list_new(&files); + if (dCam->getFileList(files) == DIGICAM_NO_ERROR) { // Avoid any output in case of no files found (VDR crashes) - fileCount = files.count; - - if (files.count > 0) { + fileCount = gp_list_count(files); + if (fileCount > 0) { // walk through file list and download files - for (currentFile=0; currentFilegetFile( files.entry[currentFile].name, file ) != DIGICAM_NO_ERROR) { + if ( dCam->getFile( name, file ) != DIGICAM_NO_ERROR) { break; } @@ -77,7 +77,7 @@ OSDStatus("Storing file"); // Saving file to disc - snprintf( buf, 100, "%s/%s", cFactsheetBase::getCopyDestination(), files.entry[currentFile].name ); + snprintf( buf, 100, "%s/%s", cFactsheetBase::getCopyDestination(), name ); dsyslog("Saving image to disc"); --- digicam-1.0.2/facts-directory.c.orig 2006-09-28 12:41:53.000000000 +0200 +++ digicam-1.0.2/facts-directory.c 2007-02-11 21:09:34.000000000 +0100 @@ -47,7 +47,7 @@ cFactsheetDirectory::cFactsheetDirectory(cDirItem *file): cFactsheetBase( tr("Directory download"), file) { - CameraList files; + CameraList *files; CameraFileInfo fileInfo; unsigned long totalFileSize = 0; @@ -63,19 +63,24 @@ digitalCamera.setDirectory( "/", fileItem->Path() ); // Get filelist - if (digitalCamera.getFileList( &files ) != DIGICAM_NO_ERROR) { + gp_list_new(&files); + if (digitalCamera.getFileList( files ) != DIGICAM_NO_ERROR) { cDigicamLogger::reportCameraError( digitalCamera.getErrNo() ); return; } - fileCount = files.count; + fileCount = gp_list_count(files); // walk through file list and get directory parameter (size, file count ) - for (int i=0; iName ); - addAttribute( tr("File count"), files.count ); + addAttribute( tr("File count"), gp_list_count(files)); addAttribute( tr("Size of all files"), ((double) totalFileSize) / 1024 / 1024, "mb" ); addAttribute( tr("Store destination"), getCopyDestination() ); }