diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2009-02-16 08:09:49 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2009-02-16 08:09:49 +0000 |
commit | bb3d18289e752db9dff5f7e60e5368f46bdd1a8a (patch) | |
tree | 8b96a77cc35ca978600cbe450a0503d3dd6dc5aa /camlibs/pccam300 | |
parent | 2d0eae7c878f9ee870df185d27e0fafd120a4b42 (diff) | |
download | libgphoto2-bb3d18289e752db9dff5f7e60e5368f46bdd1a8a.tar.gz |
Batch commit from weekend work:
- removed "type" from CameraFile handling:
- all put_file functions and hooks get "type" as argument now
- added type to the set_file_info_noop call
- started removal of "name" from CameraFile
- generate new filename from original filename + camerafile type + mimetype
- new gp_camera_autodetect() helper function
- adapted all drivers.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@11818 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/pccam300')
-rw-r--r-- | camlibs/pccam300/library.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/camlibs/pccam300/library.c b/camlibs/pccam300/library.c index 958d17838..392e89391 100644 --- a/camlibs/pccam300/library.c +++ b/camlibs/pccam300/library.c @@ -150,11 +150,9 @@ file_list_func (CameraFilesystem *fs, const char *folder, break; } - if (file) { - gp_file_set_type (file, GP_FILE_TYPE_NORMAL); - gp_file_set_name (file, fn); + if (file) gp_file_set_data_and_size (file, buffer, size); - } else + else free (buffer); /* @@ -163,16 +161,8 @@ file_list_func (CameraFilesystem *fs, const char *folder, * */ gp_filesystem_append (camera->fs, folder, fn, context); gp_filesystem_set_info_noop (camera->fs, folder, fn, info, context); - /* FIXME: This is disabled for now, due to it seeming to - * cause corruption within libgphoto itself. - * A side effect of this is that file caching does - * not happen, so files must be downloaded twice if - * they are to be saved to disk. - * NWG: Sun 19th January 2003. - * - * gp_filesystem_set_file_noop (camera->fs, folder, file, - * context); - */ + gp_filesystem_set_file_noop (camera->fs, folder, fn, GP_FILE_TYPE_NORMAL, + file, context); gp_file_unref (file); gp_context_idle (context); @@ -206,9 +196,7 @@ get_file_func (CameraFilesystem *fs, const char *folder, default: return GP_ERROR_NOT_SUPPORTED; } - gp_file_set_data_and_size (file, data, size); - gp_file_set_name (file, filename); - return GP_OK; + return gp_file_set_data_and_size (file, data, size); } static int |