1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../vdr-digicam/gphoto-list.patch
5 # Copyright (C) 2008 - 2009 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
15 # --- T2-COPYRIGHT-NOTE-END ---
17 --- digicam-1.0.2/cameralist.c.orig 2006-09-28 12:41:53.000000000 +0200
18 +++ digicam-1.0.2/cameralist.c 2007-02-11 21:09:49.000000000 +0100
20 // check pre processor option to disable real scan and produce sample entries
22 // libgphoto2 struct for folder/file list
26 if (!digitalCamera.isAvailable())
29 digitalCamera.setDirectory( src->BaseDir(), subdir );
32 + gp_list_new(&result);
34 case stDir: // Scan for directories
35 - digitalCamera.getFolderList( &result );
36 + digitalCamera.getFolderList( result );
38 case stFile: // Scan for files
39 - digitalCamera.getFileList( &result );
40 + digitalCamera.getFileList( result );
45 // Display item for each result entry
46 - for (int i=0; i<result.count; i++) {
47 - DoItem(src, subdir, result.entry[i].name );
48 + for (int i=0; i < gp_list_count(result); i++) {
50 + gp_list_get_name(result, i, &name);
51 + DoItem(src, subdir, name );
55 --- digicam-1.0.2/digitalcamera.c.orig 2006-09-28 12:41:53.000000000 +0200
56 +++ digicam-1.0.2/digitalcamera.c 2007-02-11 20:58:54.000000000 +0100
58 printf("%s\n", cameraDirectory);
60 if (list != NULL) // init result count to avoid conflicts
61 - list->count = 0; // when error occurs
62 + gp_list_unref(list);
64 if (camera != NULL && list != NULL) {
65 lastError = gp_camera_folder_list_folders( camera, cameraDirectory, list, NULL);
67 // Fill the passed structure with filelist of current directory
68 int DigitalCamera::getFileList(CameraList *list) {
69 if (list != NULL) // init result count to avoid conflicts
70 - list->count = 0; // when error occurs
71 + gp_list_unref(list);
73 if (camera != NULL && list != NULL) {
74 lastError = gp_camera_folder_list_files( camera, cameraDirectory, list, NULL);
75 --- digicam-1.0.2/directory-loader.c.orig 2007-02-11 21:10:03.000000000 +0100
76 +++ digicam-1.0.2/directory-loader.c 2007-02-11 21:13:20.000000000 +0100
80 void cDirectoryLoader::Download(void) {
84 CameraFile *file = NULL;
85 char buf[FACTSHEET_BUFLEN];
89 printf("cDirectoryLoader::Download\n" );
92 dCam->setDirectory( "/", PathOnCamera );
94 - if (dCam->getFileList( &files ) == DIGICAM_NO_ERROR) {
95 + gp_list_new(&files);
96 + if (dCam->getFileList(files) == DIGICAM_NO_ERROR) {
97 // Avoid any output in case of no files found (VDR crashes)
98 - fileCount = files.count;
100 - if (files.count > 0) {
101 + fileCount = gp_list_count(files);
102 + if (fileCount > 0) {
103 // walk through file list and download files
104 - for (currentFile=0; currentFile<files.count; currentFile++) {
105 + for (currentFile=0; currentFile < gp_list_count(files); currentFile++) {
106 if ( !Running() ) // Cancel thread?
111 OSDStatus("Loading file");
113 - dsyslog("Digicam: Loading file '%s'", files.entry[currentFile].name );
114 + gp_list_get_name (files, currentFile, &name);
115 + dsyslog("Digicam: Loading file '%s'", name );
117 // get file from camera
118 - if ( dCam->getFile( files.entry[currentFile].name, file ) != DIGICAM_NO_ERROR) {
119 + if ( dCam->getFile( name, file ) != DIGICAM_NO_ERROR) {
124 OSDStatus("Storing file");
126 // Saving file to disc
127 - snprintf( buf, 100, "%s/%s", cFactsheetBase::getCopyDestination(), files.entry[currentFile].name );
128 + snprintf( buf, 100, "%s/%s", cFactsheetBase::getCopyDestination(), name );
130 dsyslog("Saving image to disc");
132 --- digicam-1.0.2/facts-directory.c.orig 2006-09-28 12:41:53.000000000 +0200
133 +++ digicam-1.0.2/facts-directory.c 2007-02-11 21:09:34.000000000 +0100
135 cFactsheetDirectory::cFactsheetDirectory(cDirItem *file):
136 cFactsheetBase( tr("Directory download"), file) {
140 CameraFileInfo fileInfo;
141 unsigned long totalFileSize = 0;
144 digitalCamera.setDirectory( "/", fileItem->Path() );
147 - if (digitalCamera.getFileList( &files ) != DIGICAM_NO_ERROR) {
148 + gp_list_new(&files);
149 + if (digitalCamera.getFileList( files ) != DIGICAM_NO_ERROR) {
150 cDigicamLogger::reportCameraError( digitalCamera.getErrNo() );
154 - fileCount = files.count;
155 + fileCount = gp_list_count(files);
157 // walk through file list and get directory parameter (size, file count )
158 - for (int i=0; i<files.count; i++) {
159 + for (int i=0; i<gp_list_count(files); i++) {
160 + const char *name, *value;
161 + gp_list_get_name(files, i, &name);
162 + gp_list_get_value(files, i, &value);
165 - printf("Computing file %s\n", files.entry[i].name );
166 + printf("Computing file %s\n", name );
168 - if (digitalCamera.getFileInformation( &fileInfo, files.entry[i].name ) !=
169 + if (digitalCamera.getFileInformation( &fileInfo, name ) !=
171 cDigicamLogger::reportCameraError( digitalCamera.getErrNo() );
176 addAttribute( tr("Directory"), fileItem->Name );
177 - addAttribute( tr("File count"), files.count );
178 + addAttribute( tr("File count"), gp_list_count(files));
179 addAttribute( tr("Size of all files"), ((double) totalFileSize) / 1024 / 1024, "mb" );
180 addAttribute( tr("Store destination"), getCopyDestination() );