|
|
@ -52,37 +52,61 @@ GPContextFeedback GPStatus::cancel_func(GPContext *, void *) {
|
|
|
|
return (cancel ? GP_CONTEXT_FEEDBACK_CANCEL : GP_CONTEXT_FEEDBACK_OK);
|
|
|
|
return (cancel ? GP_CONTEXT_FEEDBACK_CANCEL : GP_CONTEXT_FEEDBACK_OK);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GPStatus::error_func(GPContext *, const char *format, va_list args, void *) {
|
|
|
|
void GPStatus::error_func(GPContext *,
|
|
|
|
|
|
|
|
# ifdef HAVE_GPHOTO2_5
|
|
|
|
|
|
|
|
const char *buf,
|
|
|
|
|
|
|
|
# else
|
|
|
|
|
|
|
|
const char *format, va_list args,
|
|
|
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
void *) {
|
|
|
|
|
|
|
|
# ifndef HAVE_GPHOTO2_5
|
|
|
|
char buf[4096] = "";
|
|
|
|
char buf[4096] = "";
|
|
|
|
int nSize = vsnprintf( buf, 4096, format, args );
|
|
|
|
int nSize = vsnprintf( buf, 4096, format, args );
|
|
|
|
if(nSize > 4094) {
|
|
|
|
if(nSize > 4094) {
|
|
|
|
nSize = 4094;
|
|
|
|
nSize = 4094;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
buf[nSize] = '\0';
|
|
|
|
buf[nSize] = '\0';
|
|
|
|
|
|
|
|
# endif
|
|
|
|
TQString error;
|
|
|
|
TQString error;
|
|
|
|
error = error.fromLocal8Bit(buf);
|
|
|
|
error = error.fromLocal8Bit(buf);
|
|
|
|
GPMessages::gpMessagesWrapper()->emit errorMessage(error);
|
|
|
|
GPMessages::gpMessagesWrapper()->emit errorMessage(error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GPStatus::status_func (GPContext *, const char *format, va_list args, void *) {
|
|
|
|
void GPStatus::status_func (GPContext *,
|
|
|
|
|
|
|
|
# ifdef HAVE_GPHOTO2_5
|
|
|
|
|
|
|
|
const char *buf,
|
|
|
|
|
|
|
|
# else
|
|
|
|
|
|
|
|
const char *format, va_list args,
|
|
|
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
void *) {
|
|
|
|
|
|
|
|
# ifndef HAVE_GPHOTO2_5
|
|
|
|
char buf[4096] = "";
|
|
|
|
char buf[4096] = "";
|
|
|
|
int nSize = vsnprintf( buf, 4096, format, args );
|
|
|
|
int nSize = vsnprintf( buf, 4096, format, args );
|
|
|
|
if(nSize > 4094) {
|
|
|
|
if(nSize > 4094) {
|
|
|
|
nSize = 4094;
|
|
|
|
nSize = 4094;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
buf[nSize] = '\0';
|
|
|
|
buf[nSize] = '\0';
|
|
|
|
|
|
|
|
# endif
|
|
|
|
TQString status;
|
|
|
|
TQString status;
|
|
|
|
status = status.fromLocal8Bit(buf);
|
|
|
|
status = status.fromLocal8Bit(buf);
|
|
|
|
GPMessages::gpMessagesWrapper()->emit statusChanged(status);
|
|
|
|
GPMessages::gpMessagesWrapper()->emit statusChanged(status);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int GPStatus::progress_start_func(GPContext *, float _target, const char *format, va_list args, void *) {
|
|
|
|
unsigned int GPStatus::progress_start_func(GPContext *, float _target,
|
|
|
|
|
|
|
|
# ifdef HAVE_GPHOTO2_5
|
|
|
|
|
|
|
|
const char *buf,
|
|
|
|
|
|
|
|
# else
|
|
|
|
|
|
|
|
const char *format, va_list args,
|
|
|
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
void *) {
|
|
|
|
|
|
|
|
# ifndef HAVE_GPHOTO2_5
|
|
|
|
char buf[4096] = "";
|
|
|
|
char buf[4096] = "";
|
|
|
|
int nSize = vsnprintf( buf, 4096, format, args );
|
|
|
|
int nSize = vsnprintf( buf, 4096, format, args );
|
|
|
|
if(nSize > 4094) {
|
|
|
|
if(nSize > 4094) {
|
|
|
|
nSize = 4094;
|
|
|
|
nSize = 4094;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
buf[nSize] = '\0';
|
|
|
|
buf[nSize] = '\0';
|
|
|
|
|
|
|
|
# endif
|
|
|
|
TQString prog;
|
|
|
|
TQString prog;
|
|
|
|
prog = prog.fromLocal8Bit(buf);
|
|
|
|
prog = prog.fromLocal8Bit(buf);
|
|
|
|
target = _target;
|
|
|
|
target = _target;
|
|
|
|