By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release. View | Details | Raw Unified | Return to bug 1393
Collapse All | Expand All

(-)a/config.h.cmake (+3 lines)
Lines 45-47 Link Here
45
45
46
// ksnapshop
46
// ksnapshop
47
#cmakedefine HAVE_X11_EXTENSIONS_SHAPE_H 1
47
#cmakedefine HAVE_X11_EXTENSIONS_SHAPE_H 1
48
49
// kamera
50
#cmakedefine HAVE_GPHOTO2_5 1
(-)a/kamera/ConfigureChecks.cmake (+8 lines)
Lines 13-15 pkg_search_module( GPHOTO2 libgphoto2 ) Link Here
13
if( NOT GPHOTO2_FOUND )
13
if( NOT GPHOTO2_FOUND )
14
  tde_message_fatal( "libgphoto2 is required, but was not found on your system" )
14
  tde_message_fatal( "libgphoto2 is required, but was not found on your system" )
15
endif( )
15
endif( )
16
17
check_library_exists(gphoto2_port gp_port_info_get_name "" GPHOTO2_5)
18
if(GPHOTO2_5)
19
  message(STATUS "  found libgphoto2 2.5")
20
else(GPHOTO2_5)
21
  message(STATUS "  assuming libgphoto2 2.4")
22
endif(GPHOTO2_5)
23
set(HAVE_GPHOTO2_5 ${GPHOTO2_5})
(-)a/kamera/kcontrol/kameradevice.cpp (-1 / +10 lines)
Lines 37-42 Link Here
37
#include <kmessagebox.h>
37
#include <kmessagebox.h>
38
#include <kdebug.h>
38
#include <kdebug.h>
39
39
40
#include "config.h"
41
40
extern "C" {
42
extern "C" {
41
	#include <gphoto2.h>
43
	#include <gphoto2.h>
42
}
44
}
Lines 118-126 bool KCamera::initCamera() Link Here
118
		gp_port_info_list_new(&il);
120
		gp_port_info_list_new(&il);
119
		gp_port_info_list_load(il);
121
		gp_port_info_list_load(il);
120
		gp_port_info_list_get_info(il, gp_port_info_list_lookup_path(il, m_path.local8Bit().data()), &info);
122
		gp_port_info_list_get_info(il, gp_port_info_list_lookup_path(il, m_path.local8Bit().data()), &info);
121
		gp_port_info_list_free(il);
122
		gp_camera_set_abilities(m_camera, m_abilities);
123
		gp_camera_set_abilities(m_camera, m_abilities);
123
		gp_camera_set_port_info(m_camera, info);
124
		gp_camera_set_port_info(m_camera, info);
125
		gp_port_info_list_free(il);
124
126
125
		// this might take some time (esp. for non-existant camera) - better be done asynchronously
127
		// this might take some time (esp. for non-existant camera) - better be done asynchronously
126
		result = gp_camera_init(m_camera, glob_context);
128
		result = gp_camera_init(m_camera, glob_context);
Lines 346-353 KameraDeviceSelectDialog::KameraDeviceSelectDialog(TQWidget *parent, KCamera *de Link Here
346
	}
348
	}
347
	for (int i = 0; i < gphoto_ports; i++) {
349
	for (int i = 0; i < gphoto_ports; i++) {
348
		if (gp_port_info_list_get_info(list, i, &info) >= 0) {
350
		if (gp_port_info_list_get_info(list, i, &info) >= 0) {
351
#ifdef HAVE_GPHOTO2_5
352
			char *xpath;
353
			gp_port_info_get_path (info, &xpath);
354
			if (strncmp(xpath, "serial:", 7) == 0)
355
				m_serialPortCombo->insertItem(TQString::fromLatin1(xpath).mid(7));
356
#else
349
			if (strncmp(info.path, "serial:", 7) == 0)
357
			if (strncmp(info.path, "serial:", 7) == 0)
350
				m_serialPortCombo->insertItem(TQString::fromLatin1(info.path).mid(7));
358
				m_serialPortCombo->insertItem(TQString::fromLatin1(info.path).mid(7));
359
#endif
351
		}
360
		}
352
	}
361
	}
353
	gp_port_info_list_free(list);
362
	gp_port_info_list_free(list);
(-)a/kamera/kioslave/kamera.cpp (-4 / +35 lines)
Lines 55-65 extern "C" Link Here
55
{
55
{
56
	KDE_EXPORT int kdemain(int argc, char **argv);
56
	KDE_EXPORT int kdemain(int argc, char **argv);
57
57
58
#ifdef HAVE_GPHOTO2_5
59
	static void frontendCameraStatus(GPContext *context, const char *status, void *data);
60
	static unsigned int frontendProgressStart(
61
		GPContext *context, float totalsize, const char *status,
62
		void *data
63
	);
64
#else
58
	static void frontendCameraStatus(GPContext *context, const char *format, va_list args, void *data);
65
	static void frontendCameraStatus(GPContext *context, const char *format, va_list args, void *data);
59
	static unsigned int frontendProgressStart(
66
	static unsigned int frontendProgressStart(
60
		GPContext *context, float totalsize, const char *format,
67
		GPContext *context, float totalsize, const char *format,
61
		va_list args, void *data
68
		va_list args, void *data
62
	);
69
	);
70
#endif
63
	static void frontendProgressUpdate(
71
	static void frontendProgressUpdate(
64
		GPContext *context, unsigned int id, float current, void *data
72
		GPContext *context, unsigned int id, float current, void *data
65
	);
73
	);
Lines 785-795 void KameraProtocol::setHost(const TQString& host, int port, const TQString& use Link Here
785
			return;
793
			return;
786
		}
794
		}
787
		gp_port_info_list_get_info(port_info_list, idx, &port_info);
795
		gp_port_info_list_get_info(port_info_list, idx, &port_info);
788
		gp_port_info_list_free(port_info_list);
789
796
790
		// create a new camera object
797
		// create a new camera object
791
		gpr = gp_camera_new(&m_camera);
798
		gpr = gp_camera_new(&m_camera);
792
		if(gpr != GP_OK) {
799
		if(gpr != GP_OK) {
800
			gp_port_info_list_free(port_info_list);
793
			error(KIO::ERR_UNKNOWN, gp_result_as_string(gpr));
801
			error(KIO::ERR_UNKNOWN, gp_result_as_string(gpr));
794
			return;
802
			return;
795
		}
803
		}
Lines 805-810 void KameraProtocol::setHost(const TQString& host, int port, const TQString& use Link Here
805
		gp_camera_set_port_speed(m_camera, 0); // TODO: the value needs to be configurable
813
		gp_camera_set_port_speed(m_camera, 0); // TODO: the value needs to be configurable
806
		kdDebug(7123) << "Opening camera model " << user << " at " << host << endl;
814
		kdDebug(7123) << "Opening camera model " << user << " at " << host << endl;
807
815
816
		gp_port_info_list_free(port_info_list);
817
808
		TQString errstr;
818
		TQString errstr;
809
		if (!openCamera(errstr)) {
819
		if (!openCamera(errstr)) {
810
			kdDebug(7123) << "Unable to init camera: " << gp_result_as_string(gpr) << endl;
820
			kdDebug(7123) << "Unable to init camera: " << gp_result_as_string(gpr) << endl;
Lines 986-995 void frontendProgressUpdate( Link Here
986
}
996
}
987
997
988
unsigned int frontendProgressStart(
998
unsigned int frontendProgressStart(
989
	GPContext * /*context*/, float totalsize, const char *format, va_list args,
999
	GPContext * /*context*/, float totalsize,
1000
#ifdef HAVE_GPHOTO2_5
1001
	const char *status,
1002
#else
1003
	const char *format, va_list args,
1004
#endif
990
	void *data
1005
	void *data
991
) {
1006
) {
992
	KameraProtocol *object = (KameraProtocol*)data;
1007
	KameraProtocol *object = (KameraProtocol*)data;
1008
#ifndef HAVE_GPHOTO2_5
993
	char *status;
1009
	char *status;
994
1010
995
	/* We must copy the va_list to walk it twice, or all hell 
1011
	/* We must copy the va_list to walk it twice, or all hell 
Lines 1023-1036 unsigned int frontendProgressStart( Link Here
1023
1039
1024
	object->infoMessage(TQString::fromLocal8Bit(status));
1040
	object->infoMessage(TQString::fromLocal8Bit(status));
1025
	delete [] status;
1041
	delete [] status;
1042
#else
1043
	/* libgphoto2 2.5 has resolved this already, no need for print */
1044
	object->infoMessage(TQString::fromLocal8Bit(status));
1045
#endif
1026
	object->totalSize((int)totalsize); // hack: call slot directly
1046
	object->totalSize((int)totalsize); // hack: call slot directly
1027
	return GP_OK;
1047
	return GP_OK;
1028
}
1048
}
1029
1049
1030
// this callback function is activated on every status message from gphoto2
1050
// this callback function is activated on every status message from gphoto2
1031
static void frontendCameraStatus(GPContext * /*context*/, const char *format, va_list args, void *data)
1051
static void frontendCameraStatus(
1032
{
1052
	GPContext * /*context*/,
1053
#ifdef HAVE_GPHOTO2_5
1054
	const char *status,
1055
#else
1056
	const char *format, va_list args,
1057
#endif
1058
	void *data
1059
) {
1033
	KameraProtocol *object = (KameraProtocol*)data;
1060
	KameraProtocol *object = (KameraProtocol*)data;
1061
#ifndef HAVE_GPHOTO2_5
1034
	char *status;
1062
	char *status;
1035
1063
1036
	/* We must copy the va_list to walk it twice, or all hell 
1064
	/* We must copy the va_list to walk it twice, or all hell 
Lines 1063-1066 static void frontendCameraStatus(GPContext * /*context*/, const char *format, va Link Here
1063
#endif
1091
#endif
1064
	object->infoMessage(TQString::fromLocal8Bit(status));
1092
	object->infoMessage(TQString::fromLocal8Bit(status));
1065
	delete [] status;
1093
	delete [] status;
1094
#else
1095
	object->infoMessage(TQString::fromLocal8Bit(status));
1096
#endif
1066
}
1097
}

Return to bug 1393