2001-10-18 Lutz M�ller <urc8@rz.uni-karlsruhe.de>
* camlibs/canon.c: Don't use camera->model.
* libgphoto2/gphoto2-camera.[c,h]: Remove camera->model.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2604 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
@@ -1207,19 +1207,21 @@ camera_folder_put_file (Camera *camera, const char *folder, CameraFile * file)
|
||||
char destpath[300], destname[300], dir[300], dcf_root_dir[10];
|
||||
int j, dirnum = 0;
|
||||
char buf[10];
|
||||
CameraAbilities a;
|
||||
|
||||
gp_debug_printf (GP_DEBUG_LOW, "canon", "camera_folder_put_file()");
|
||||
|
||||
if (check_readiness (camera) != 1)
|
||||
return GP_ERROR;
|
||||
|
||||
gp_camera_get_abilities (camera, &a);
|
||||
if (cs->speed > 57600 &&
|
||||
(strcmp (camera->model, "Canon PowerShot A50") == 0
|
||||
|| strcmp (camera->model, "Canon PowerShot Pro70") == 0)) {
|
||||
(!strcmp (a.model, "Canon PowerShot A50") ||
|
||||
!strcmp (a.model, "Canon PowerShot Pro70"))) {
|
||||
gp_camera_message (camera,
|
||||
_
|
||||
("Speeds greater than 57600 are not supported for uploading to this camera"));
|
||||
return GP_ERROR;
|
||||
return GP_ERROR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
if (!check_readiness (camera)) {
|
||||
|
||||
@@ -155,8 +155,7 @@ gp_camera_set_model (Camera *camera, const char *model)
|
||||
|
||||
CHECK_RESULT (gp_camera_abilities_by_name (model, &abilities));
|
||||
CHECK_RESULT (gp_camera_set_abilities (camera, abilities));
|
||||
strncpy (camera->model, model, sizeof (camera->model));
|
||||
|
||||
|
||||
return (GP_OK);
|
||||
}
|
||||
|
||||
@@ -196,9 +195,6 @@ gp_camera_set_abilities (Camera *camera, CameraAbilities abilities)
|
||||
|
||||
memcpy (&camera->pc->a, &abilities, sizeof (CameraAbilities));
|
||||
|
||||
//FIXME: Remove this. Up to now, some camera drivers still need it.
|
||||
strcpy (camera->model, abilities.model);
|
||||
|
||||
return (GP_OK);
|
||||
}
|
||||
|
||||
@@ -690,13 +686,19 @@ int
|
||||
gp_camera_init (Camera *camera)
|
||||
{
|
||||
CameraList list;
|
||||
CameraAbilities a;
|
||||
const char *model, *port;
|
||||
CameraLibraryInitFunc init_func;
|
||||
|
||||
gp_log (GP_LOG_DEBUG, "gphoto2-camera", "Initializing camera...");
|
||||
|
||||
CHECK_NULL (camera);
|
||||
gp_camera_status (camera, _("Initializing camera..."));
|
||||
|
||||
if (!strcmp (camera->pc->a.model, ""))
|
||||
gp_camera_status (camera, _("Initializing camera..."));
|
||||
else
|
||||
gp_camera_status (camera, _("Initializing '%s'..."),
|
||||
camera->pc->a.model);
|
||||
|
||||
/*
|
||||
* If the port or the model hasn't been indicated, try to
|
||||
@@ -715,6 +717,8 @@ gp_camera_init (Camera *camera)
|
||||
return (GP_ERROR_MODEL_NOT_FOUND);
|
||||
|
||||
CRS (camera, gp_list_get_name (&list, 0, &model));
|
||||
CRS (camera, gp_camera_abilities_by_name (model, &a));
|
||||
CRS (camera, gp_camera_set_abilities (camera, a));
|
||||
CRS (camera, gp_camera_set_model (camera, model));
|
||||
CRS (camera, gp_list_get_value (&list, 0, &port));
|
||||
CRS (camera, gp_camera_set_port_path (camera, port));
|
||||
|
||||
@@ -129,12 +129,6 @@ typedef struct _CameraPrivateFrontend CameraPrivateFrontend;
|
||||
|
||||
struct _Camera {
|
||||
|
||||
/*
|
||||
* Don't use, use gp_camera_get_abilities and abilities.model
|
||||
* instead. This entry will disappear at some point in the future.
|
||||
*/
|
||||
char model[128];
|
||||
|
||||
/*
|
||||
* Don't use. It'll disappear sooner or later
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user