summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Andriot <francois.andriot@free.fr>2013-01-29 21:57:20 +0100
committerSlávek Banko <slavek.banko@axis.cz>2013-01-29 21:59:17 +0100
commit688e263f5d535c708508f22c951ebb874b8c9462 (patch)
treec400a585fd1d84694f5a0cdd32584f20e7c9549f
parent7a14e1be4481f196409dc600acd7a2f3fbc58a80 (diff)
downloaddigikam-688e263f5d535c708508f22c951ebb874b8c9462.tar.gz
digikam-688e263f5d535c708508f22c951ebb874b8c9462.zip
Add support for gphoto 2.5
Based on KDE GIT commit b224133f (cherry picked from commit 00fa7147e473af09c44f7fbb2482349c4f23200c)
-rw-r--r--digikam/configure.in.in2
-rw-r--r--digikam/utilities/cameragui/gpcamera.cpp15
2 files changed, 17 insertions, 0 deletions
diff --git a/digikam/configure.in.in b/digikam/configure.in.in
index 728d416..6ed6a0d 100644
--- a/digikam/configure.in.in
+++ b/digikam/configure.in.in
@@ -129,6 +129,8 @@ AC_SUBST(LCMS_LIBS)
AC_PATH_PROG(GPHOTO_CONFIG,gphoto2-config)
AC_PATH_PROG(GPHOTO_PORT_CONFIG,gphoto2-port-config)
if test -n "${GPHOTO_CONFIG}"; then
+ GPHOTO_VERSION="`$GPHOTO_CONFIG --version`"
+ case "${GPHOTO_VERSION}" in "libgphoto2 2.5"*) CXXFLAGS="$CXXFLAGS -DHAVE_GPHOTO25";; esac
GPHOTO_CFLAGS="`$GPHOTO_CONFIG --cflags`"
AC_SUBST(GPHOTO_CFLAGS)
LIB_GPHOTO="`$GPHOTO_CONFIG --libs` `$GPHOTO_PORT_CONFIG --libs`"
diff --git a/digikam/utilities/cameragui/gpcamera.cpp b/digikam/utilities/cameragui/gpcamera.cpp
index 28b7f3e..7139e98 100644
--- a/digikam/utilities/cameragui/gpcamera.cpp
+++ b/digikam/utilities/cameragui/gpcamera.cpp
@@ -845,10 +845,19 @@ bool GPCamera::uploadItem(const TQString& folder, const TQString& itemName, cons
m_status = new GPStatus;
+#ifdef HAVE_GPHOTO25
errorCode = gp_camera_folder_put_file(d->camera,
TQFile::encodeName(folder),
+ TQFile::encodeName(itemName),
+ GP_FILE_TYPE_NORMAL,
cfile,
m_status->context);
+#else
+ errorCode = gp_camera_folder_put_file(d->camera,
+ TQFile::encodeName(folder),
+ cfile,
+ m_status->context);
+#endif
if (errorCode != GP_OK)
{
DDebug() << "Failed to upload item to camera!" << endl;
@@ -1108,7 +1117,13 @@ void GPCamera::getSupportedPorts(TQStringList& plist)
for (int i = 0 ; i < numPorts ; i++)
{
gp_port_info_list_get_info( list, i, &info );
+#ifdef HAVE_GPHOTO25
+ char *xpath;
+ gp_port_info_get_name( info, &xpath );
+ plist.append( xpath );
+#else
plist.append( info.path );
+#endif
}
}