$OpenBSD: patch-kamera_kioslave_kamera_cpp,v 1.1 2013/01/19 11:28:00 zhuk Exp $
Fix compilation with GPhoto 2.5. Based on ideas from those patches:
http://bugsfiles.kde.org/attachment.cgi?id=73176
http://www.mail-archive.com/opensuse-commit@opensuse.org/msg30153.html
--- kamera/kioslave/kamera.cpp.orig	Sat Jan 19 01:11:30 2013
+++ kamera/kioslave/kamera.cpp	Sat Jan 19 01:25:18 2013
@@ -55,10 +55,10 @@ extern "C"
 {
 	KDE_EXPORT int kdemain(int argc, char **argv);
 
-	static void frontendCameraStatus(GPContext *context, const char *format, va_list args, void *data);
+	static void frontendCameraStatus(GPContext *context, const char *format, void *data);
 	static unsigned int frontendProgressStart(
-		GPContext *context, float totalsize, const char *format,
-		va_list args, void *data
+		GPContext *context, float totalsize, const char *str,
+		void *data
 	);
 	static void frontendProgressUpdate(
 		GPContext *context, unsigned int id, float current, void *data
@@ -857,10 +857,7 @@ void KameraProtocol::translateFileToUDS(UDSEntry &udsE
 	udsEntry.append(atom);
 
 	atom.m_uds = UDS_NAME;
-	if (info.file.fields & GP_FILE_INFO_NAME)
-		atom.m_str = QString::fromLocal8Bit(info.file.name);
-	else
-		atom.m_str = name;
+	atom.m_str = name;
 	udsEntry.append(atom);
 
 	if (info.file.fields & GP_FILE_INFO_SIZE) {
@@ -986,81 +983,17 @@ void frontendProgressUpdate(
 }
 
 unsigned int frontendProgressStart(
-	GPContext * /*context*/, float totalsize, const char *format, va_list args,
-	void *data
+	GPContext * /*context*/, float totalsize, const char *str, void *data
 ) {
 	KameraProtocol *object = (KameraProtocol*)data;
-	char *status;
-
-	/* We must copy the va_list to walk it twice, or all hell 
-	 * breaks loose on non-i386 platforms.
-	 */
-#if defined(HAVE_VA_COPY) || defined(HAVE___VA_COPY)
-	va_list xvalist;
-# ifdef HAVE_VA_COPY
-	va_copy(xvalist, args);
-# elif HAVE___VA_COPY
-	__va_copy(xvalist, args);
-# endif
-	int size=vsnprintf(NULL, 0, format, xvalist);
-	if(size<=0)
-		return GP_OK; // vsnprintf is broken, better don't do anything.
-
-	status=new char[size+1];
-# ifdef HAVE_VA_COPY
-	va_copy(xvalist, args);
-# elif HAVE___VA_COPY
-	__va_copy(xvalist, args);
-# endif
-	vsnprintf(status, size+1, format, xvalist);
-#else
-	/* We cannot copy the va_list, so make sure we 
-	 * walk it just _once_.
-	 */
-	status=new char[300];
-	vsnprintf(status, 300, format, args);
-#endif
-
-	object->infoMessage(QString::fromLocal8Bit(status));
-	delete [] status;
+	object->infoMessage(QString::fromLocal8Bit(str));
 	object->totalSize((int)totalsize); // hack: call slot directly
 	return GP_OK;
 }
 
 // this callback function is activated on every status message from gphoto2
-static void frontendCameraStatus(GPContext * /*context*/, const char *format, va_list args, void *data)
+static void frontendCameraStatus(GPContext * /*context*/, const char *str, void *data)
 {
 	KameraProtocol *object = (KameraProtocol*)data;
-	char *status;
-
-	/* We must copy the va_list to walk it twice, or all hell 
-	 * breaks loose on non-i386 platforms.
-	 */
-#if defined(HAVE_VA_COPY) || defined(HAVE___VA_COPY)
-	va_list xvalist;
-# ifdef HAVE_VA_COPY
-	va_copy(xvalist, args);
-# elif HAVE___VA_COPY
-	__va_copy(xvalist, args);
-# endif
-	int size=vsnprintf(NULL, 0, format, xvalist);
-	if(size<=0)
-		return; // vsnprintf is broken, better don't do anything.
-
-	status=new char[size+1];
-# ifdef HAVE_VA_COPY
-	va_copy(xvalist, args);
-# elif HAVE___VA_COPY
-	__va_copy(xvalist, args);
-# endif
-	vsnprintf(status, size+1, format, xvalist);
-#else
-	/* We cannot copy the va_list, so make sure we 
-	 * walk it just _once_.
-	 */
-	status=new char[300];
-	vsnprintf(status, 300, format, args);
-#endif
-	object->infoMessage(QString::fromLocal8Bit(status));
-	delete [] status;
+	object->infoMessage(QString::fromLocal8Bit(str));
 }
