2003-11-05 08:40:45 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file io_callback.C
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author unknown
|
|
|
|
|
* \author John Levon
|
|
|
|
|
* \author Jo<EFBFBD>o Luis M. Assirati
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
#include "socket_callback.h"
|
|
|
|
|
|
|
|
|
|
|
2004-07-21 19:03:21 +00:00
|
|
|
|
socket_callback::socket_callback(int fd, boost::function<void()> func)
|
|
|
|
|
: func_(func)
|
2003-11-05 08:40:45 +00:00
|
|
|
|
{
|
2004-07-21 19:03:21 +00:00
|
|
|
|
sn_.reset(new QSocketNotifier(fd, QSocketNotifier::Read, this));
|
2003-11-05 08:40:45 +00:00
|
|
|
|
connect(sn_.get(), SIGNAL(activated(int)), this, SLOT(data_received()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void socket_callback::data_received()
|
|
|
|
|
{
|
2004-07-21 19:03:21 +00:00
|
|
|
|
func_();
|
2003-11-05 08:40:45 +00:00
|
|
|
|
}
|
2006-08-16 22:10:20 +00:00
|
|
|
|
|
|
|
|
|
#include "socket_callback_moc.cpp"
|