summaryrefslogtreecommitdiffstats
path: root/kamera/kcontrol/kameradevice.cpp
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2013-01-29 20:50:07 +0100
committerSlávek Banko <[email protected]>2013-01-29 20:50:38 +0100
commitd4d1a5808bad1023c8291a52c2143b36f6b41d85 (patch)
treecea31c25494e01818dde626f2bc83553de50ab16 /kamera/kcontrol/kameradevice.cpp
parent0fed03e23520820e85c5a8c0ef1b4e69668274b6 (diff)
downloadtdegraphics-d4d1a5808bad1023c8291a52c2143b36f6b41d85.tar.gz
tdegraphics-d4d1a5808bad1023c8291a52c2143b36f6b41d85.zip
Add support for gphoto 2.5
Based on KDE GIT commit cdcf4205
Diffstat (limited to 'kamera/kcontrol/kameradevice.cpp')
-rw-r--r--kamera/kcontrol/kameradevice.cpp11
1 files changed, 10 insertions, 1 deletions
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 <kmessagebox.h>
#include <kdebug.h>
+#include "config.h"
+
extern "C" {
#include <gphoto2.h>
}
@@ -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);