From d4d1a5808bad1023c8291a52c2143b36f6b41d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Tue, 29 Jan 2013 20:50:07 +0100 Subject: Add support for gphoto 2.5 Based on KDE GIT commit cdcf4205 --- kamera/kcontrol/kameradevice.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'kamera/kcontrol/kameradevice.cpp') diff --git a/kamera/kcontrol/kameradevice.cpp b/kamera/kcontrol/kameradevice.cpp index e6f26449..572e819a 100644 --- a/kamera/kcontrol/kameradevice.cpp +++ b/kamera/kcontrol/kameradevice.cpp @@ -37,6 +37,8 @@ #include #include +#include "config.h" + extern "C" { #include } @@ -118,9 +120,9 @@ bool KCamera::initCamera() gp_port_info_list_new(&il); gp_port_info_list_load(il); gp_port_info_list_get_info(il, gp_port_info_list_lookup_path(il, m_path.local8Bit().data()), &info); - gp_port_info_list_free(il); gp_camera_set_abilities(m_camera, m_abilities); gp_camera_set_port_info(m_camera, info); + gp_port_info_list_free(il); // this might take some time (esp. for non-existant camera) - better be done asynchronously result = gp_camera_init(m_camera, glob_context); @@ -346,8 +348,15 @@ KameraDeviceSelectDialog::KameraDeviceSelectDialog(TQWidget *parent, KCamera *de } for (int i = 0; i < gphoto_ports; i++) { if (gp_port_info_list_get_info(list, i, &info) >= 0) { +#ifdef HAVE_GPHOTO2_5 + char *xpath; + gp_port_info_get_path (info, &xpath); + if (strncmp(xpath, "serial:", 7) == 0) + m_serialPortCombo->insertItem(TQString::fromLatin1(xpath).mid(7)); +#else if (strncmp(info.path, "serial:", 7) == 0) m_serialPortCombo->insertItem(TQString::fromLatin1(info.path).mid(7)); +#endif } } gp_port_info_list_free(list); -- cgit v1.2.1