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/tdeioslave/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 791-801 void KameraProtocol::setHost(const TQString& host, int port, const TQString& use Link Here
791
			return;
799
			return;
792
		}
800
		}
793
		gp_port_info_list_get_info(port_info_list, idx, &port_info);
801
		gp_port_info_list_get_info(port_info_list, idx, &port_info);
794
		gp_port_info_list_free(port_info_list);
795
802
796
		// create a new camera object
803
		// create a new camera object
797
		gpr = gp_camera_new(&m_camera);
804
		gpr = gp_camera_new(&m_camera);
798
		if(gpr != GP_OK) {
805
		if(gpr != GP_OK) {
806
			gp_port_info_list_free(port_info_list);
799
			error(TDEIO::ERR_UNKNOWN, gp_result_as_string(gpr));
807
			error(TDEIO::ERR_UNKNOWN, gp_result_as_string(gpr));
800
			return;
808
			return;
801
		}
809
		}
Lines 813-818 void KameraProtocol::setHost(const TQString& host, int port, const TQString& use Link Here
813
		gp_camera_set_port_speed(m_camera, 0); // TODO: the value needs to be configurable
821
		gp_camera_set_port_speed(m_camera, 0); // TODO: the value needs to be configurable
814
		kdDebug(7123) << "Opening camera model " << user << " at " << host << endl;
822
		kdDebug(7123) << "Opening camera model " << user << " at " << host << endl;
815
823
824
		gp_port_info_list_free(port_info_list);
825
816
		TQString errstr;
826
		TQString errstr;
817
		if (!openCamera(errstr)) {
827
		if (!openCamera(errstr)) {
818
			kdDebug(7123) << "Unable to init camera: " << gp_result_as_string(gpr) << endl;
828
			kdDebug(7123) << "Unable to init camera: " << gp_result_as_string(gpr) << endl;
Lines 994-1003 void frontendProgressUpdate( Link Here
994
}
1004
}
995
1005
996
unsigned int frontendProgressStart(
1006
unsigned int frontendProgressStart(
997
	GPContext * /*context*/, float totalsize, const char *format, va_list args,
1007
	GPContext * /*context*/, float totalsize,
1008
#ifdef HAVE_GPHOTO2_5
1009
	const char *status,
1010
#else
1011
	const char *format, va_list args,
1012
#endif
998
	void *data
1013
	void *data
999
) {
1014
) {
1000
	KameraProtocol *object = (KameraProtocol*)data;
1015
	KameraProtocol *object = (KameraProtocol*)data;
1016
#ifndef HAVE_GPHOTO2_5
1001
	char *status;
1017
	char *status;
1002
1018
1003
	/* We must copy the va_list to walk it twice, or all hell 
1019
	/* We must copy the va_list to walk it twice, or all hell 
Lines 1031-1044 unsigned int frontendProgressStart( Link Here
1031
1047
1032
	object->infoMessage(TQString::fromLocal8Bit(status));
1048
	object->infoMessage(TQString::fromLocal8Bit(status));
1033
	delete [] status;
1049
	delete [] status;
1050
#else
1051
	/* libgphoto2 2.5 has resolved this already, no need for print */
1052
	object->infoMessage(TQString::fromLocal8Bit(status));
1053
#endif
1034
	object->totalSize((int)totalsize); // hack: call slot directly
1054
	object->totalSize((int)totalsize); // hack: call slot directly
1035
	return GP_OK;
1055
	return GP_OK;
1036
}
1056
}
1037
1057
1038
// this callback function is activated on every status message from gphoto2
1058
// this callback function is activated on every status message from gphoto2
1039
static void frontendCameraStatus(GPContext * /*context*/, const char *format, va_list args, void *data)
1059
static void frontendCameraStatus(
1040
{
1060
	GPContext * /*context*/,
1061
#ifdef HAVE_GPHOTO2_5
1062
	const char *status,
1063
#else
1064
	const char *format, va_list args,
1065
#endif
1066
	void *data
1067
) {
1041
	KameraProtocol *object = (KameraProtocol*)data;
1068
	KameraProtocol *object = (KameraProtocol*)data;
1069
#ifndef HAVE_GPHOTO2_5
1042
	char *status;
1070
	char *status;
1043
1071
1044
	/* We must copy the va_list to walk it twice, or all hell 
1072
	/* We must copy the va_list to walk it twice, or all hell 
Lines 1071-1074 static void frontendCameraStatus(GPContext * /*context*/, const char *format, va Link Here
1071
#endif
1099
#endif
1072
	object->infoMessage(TQString::fromLocal8Bit(status));
1100
	object->infoMessage(TQString::fromLocal8Bit(status));
1073
	delete [] status;
1101
	delete [] status;
1102
#else
1103
	object->infoMessage(TQString::fromLocal8Bit(status));
1104
#endif
1074
}
1105
}

Return to bug 1393