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} CACHE FILEPATH "")
(-)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 (-8 / +36 lines)
Lines 55-65 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 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 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 857-866 Link Here
857
	udsEntry.append(atom);
867
	udsEntry.append(atom);
858
868
859
	atom.m_uds = UDS_NAME;
869
	atom.m_uds = UDS_NAME;
860
	if (info.file.fields & GP_FILE_INFO_NAME)
870
	atom.m_str = name;
861
		atom.m_str = TQString::fromLocal8Bit(info.file.name);
862
	else
863
		atom.m_str = name;
864
	udsEntry.append(atom);
871
	udsEntry.append(atom);
865
872
866
	if (info.file.fields & GP_FILE_INFO_SIZE) {
873
	if (info.file.fields & GP_FILE_INFO_SIZE) {
Lines 986-995 Link Here
986
}
993
}
987
994
988
unsigned int frontendProgressStart(
995
unsigned int frontendProgressStart(
989
	GPContext * /*context*/, float totalsize, const char *format, va_list args,
996
	GPContext * /*context*/, float totalsize,
997
#ifdef HAVE_GPHOTO2_5
998
	const char *status,
999
#else
1000
	const char *format, va_list args,
1001
#endif
990
	void *data
1002
	void *data
991
) {
1003
) {
992
	KameraProtocol *object = (KameraProtocol*)data;
1004
	KameraProtocol *object = (KameraProtocol*)data;
1005
#ifndef HAVE_GPHOTO2_5
993
	char *status;
1006
	char *status;
994
1007
995
	/* We must copy the va_list to walk it twice, or all hell 
1008
	/* We must copy the va_list to walk it twice, or all hell 
Lines 1023-1036 Link Here
1023
1036
1024
	object->infoMessage(TQString::fromLocal8Bit(status));
1037
	object->infoMessage(TQString::fromLocal8Bit(status));
1025
	delete [] status;
1038
	delete [] status;
1039
#else
1040
	/* libgphoto2 2.5 has resolved this already, no need for print */
1041
	object->infoMessage(TQString::fromLocal8Bit(status));
1042
#endif
1026
	object->totalSize((int)totalsize); // hack: call slot directly
1043
	object->totalSize((int)totalsize); // hack: call slot directly
1027
	return GP_OK;
1044
	return GP_OK;
1028
}
1045
}
1029
1046
1030
// this callback function is activated on every status message from gphoto2
1047
// 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)
1048
static void frontendCameraStatus(
1032
{
1049
	GPContext * /*context*/,
1050
#ifdef HAVE_GPHOTO2_5
1051
	const char *status,
1052
#else
1053
	const char *format, va_list args,
1054
#endif
1055
	void *data
1056
) {
1033
	KameraProtocol *object = (KameraProtocol*)data;
1057
	KameraProtocol *object = (KameraProtocol*)data;
1058
#ifndef HAVE_GPHOTO2_5
1034
	char *status;
1059
	char *status;
1035
1060
1036
	/* We must copy the va_list to walk it twice, or all hell 
1061
	/* We must copy the va_list to walk it twice, or all hell 
Lines 1063-1066 Link Here
1063
#endif
1088
#endif
1064
	object->infoMessage(TQString::fromLocal8Bit(status));
1089
	object->infoMessage(TQString::fromLocal8Bit(status));
1065
	delete [] status;
1090
	delete [] status;
1091
#else
1092
	object->infoMessage(TQString::fromLocal8Bit(status));
1093
#endif
1066
}
1094
}

Return to bug 1393