File gpcamera-fix-build.patch of Package kdegraphics3

Index: kdegraphics-3.5.10/kamera/kcontrol/kameradevice.cpp
===================================================================
--- kdegraphics-3.5.10.orig/kamera/kcontrol/kameradevice.cpp
+++ kdegraphics-3.5.10/kamera/kcontrol/kameradevice.cpp
@@ -273,6 +273,7 @@ CameraAbilities KCamera::abilities()
 KameraDeviceSelectDialog::KameraDeviceSelectDialog(QWidget *parent, KCamera *device)
 	: KDialogBase(parent, "kkameradeviceselect", true, i18n("Select Camera Device"), Ok | Cancel, Ok, true)
 {
+	char *xpath;
 	m_device = device;
 	connect(m_device, SIGNAL(error(const QString &)),
 		SLOT(slot_error(const QString &)));
@@ -346,8 +347,9 @@ KameraDeviceSelectDialog::KameraDeviceSe
 	}
 	for (int i = 0; i < gphoto_ports; i++) {
 		if (gp_port_info_list_get_info(list, i, &info) >= 0) {
-			if (strncmp(info.path, "serial:", 7) == 0)
-				m_serialPortCombo->insertItem(QString::fromLatin1(info.path).mid(7));
+			gp_port_info_get_name (info, &xpath);
+			if (strncmp(xpath, "serial:", 7) == 0)
+				m_serialPortCombo->insertItem(QString::fromLatin1(xpath).mid(7));
 		}
 	}
 	gp_port_info_list_free(list);
Index: kdegraphics-3.5.10/kamera/kioslave/kamera.cpp
===================================================================
--- kdegraphics-3.5.10.orig/kamera/kioslave/kamera.cpp
+++ kdegraphics-3.5.10/kamera/kioslave/kamera.cpp
@@ -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 *status, void *data);
 	static unsigned int frontendProgressStart(
-		GPContext *context, float totalsize, const char *format,
-		va_list args, void *data
+		GPContext *context, float totalsize, const char *status,
+		void *data
 	);
 	static void frontendProgressUpdate(
 		GPContext *context, unsigned int id, float current, void *data
@@ -857,10 +857,7 @@ void KameraProtocol::translateFileToUDS(
 	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,21 @@ void frontendProgressUpdate(
 }
 
 unsigned int frontendProgressStart(
-	GPContext * /*context*/, float totalsize, const char *format, va_list args,
+	GPContext * /*context*/, float totalsize, const char *status,
 	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->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 *status, 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;
 }