[Kde-imaging] extragear/libs/kipi-plugins/kameraklient
Angelo Naselli
anaselli at linux.it
Sat Dec 9 01:10:28 CET 2006
SVN commit 611626 by anaselli:
changed to get it working for new libgphoto2
CCMAIL: <kde-imaging at kde.org>
M +11 -7 gpcamera.cpp
M +8 -5 gpiface.cpp
--- trunk/extragear/libs/kipi-plugins/kameraklient/gpcamera.cpp #611625:611626
@@ -202,7 +202,7 @@
}
int GPCamera::getSubFolders(const QString& folder, QValueList<QString>& subFolderList) {
- ::CameraList *clist;
+ CameraList *clist;
gp_list_new(&clist);
if (status) {
delete status;
@@ -250,7 +250,7 @@
}
int GPCamera::getItemsInfo(const QString& folder, GPFileItemInfoList& infoList) {
- ::CameraList *clist;
+ CameraList *clist;
const char *cname;
if (status) {
delete status;
@@ -561,35 +561,39 @@
}
int GPCamera::autoDetect(QString& model, QString& port) {
- ::CameraList camList;
+ CameraList *pCamList;
CameraAbilitiesList *abilList;
GPPortInfoList *infoList;
const char *camModel_, *camPort_;
GPContext *context;
context = gp_context_new ();
+ gp_list_new(&pCamList);
gp_abilities_list_new (&abilList);
gp_abilities_list_load (abilList, context);
gp_port_info_list_new (&infoList);
gp_port_info_list_load (infoList);
- gp_abilities_list_detect (abilList, infoList, &camList, context);
+ gp_abilities_list_detect (abilList, infoList, pCamList, context);
gp_abilities_list_free (abilList);
gp_port_info_list_free (infoList);
gp_context_unref( context );
- int count = gp_list_count (&camList);
+ int count = gp_list_count (pCamList);
if (count<=0) {
+ gp_list_free(pCamList);
return -1;
}
for (int i = 0; i < count; i++) {
- gp_list_get_name (&camList, i, &camModel_);
- gp_list_get_value (&camList, i, &camPort_);
+ gp_list_get_name (pCamList, i, &camModel_);
+ gp_list_get_value (pCamList, i, &camPort_);
}
model = camModel_;
port = camPort_;
+ gp_list_free(pCamList);
+
return 0;
}
--- trunk/extragear/libs/kipi-plugins/kameraklient/gpiface.cpp #611625:611626
@@ -33,37 +33,40 @@
{
int GPIface::autoDetect(QString& model, QString& port) {
- ::CameraList camList;
+ CameraList *pCamList;
CameraAbilitiesList *abilList;
GPPortInfoList *infoList;
const char *camModel_, *camPort_;
GPContext *context;
context = gp_context_new ();
+ gp_list_new(&pCamList);
gp_abilities_list_new (&abilList);
gp_abilities_list_load (abilList, context);
gp_port_info_list_new (&infoList);
gp_port_info_list_load (infoList);
- gp_abilities_list_detect (abilList, infoList, &camList, context);
+ gp_abilities_list_detect (abilList, infoList, pCamList, context);
gp_abilities_list_free (abilList);
gp_port_info_list_free (infoList);
gp_context_unref( context );
- int count = gp_list_count (&camList);
+ int count = gp_list_count (pCamList);
if (count<=0) {
+ gp_list_free(pCamList);
return -1;
}
for (int i = 0; i < count; i++) {
- gp_list_get_name (&camList, i, &camModel_);
- gp_list_get_value (&camList, i, &camPort_);
+ gp_list_get_name (pCamList, i, &camModel_);
+ gp_list_get_value (pCamList, i, &camPort_);
}
model = camModel_;
port = camPort_;
+ gp_list_free(pCamList);
return 0;
}
More information about the Kde-imaging
mailing list