mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-14 23:12:31 +00:00
44 lines
969 B
C++
44 lines
969 B
C++
|
/**
|
|||
|
* \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 "lyxsocket.h"
|
|||
|
#include "socket_callback.h"
|
|||
|
|
|||
|
|
|||
|
socket_callback::socket_callback(LyXServerSocket * server)
|
|||
|
: server_(server)
|
|||
|
{
|
|||
|
sn_.reset(new QSocketNotifier(server->fd(), QSocketNotifier::Read, this));
|
|||
|
connect(sn_.get(), SIGNAL(activated(int)), this, SLOT(server_received()));
|
|||
|
}
|
|||
|
|
|||
|
socket_callback::socket_callback(LyXDataSocket * data)
|
|||
|
: data_(data)
|
|||
|
{
|
|||
|
sn_.reset(new QSocketNotifier(data->fd(), QSocketNotifier::Read, this));
|
|||
|
connect(sn_.get(), SIGNAL(activated(int)), this, SLOT(data_received()));
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
void socket_callback::server_received()
|
|||
|
{
|
|||
|
server_->serverCallback();
|
|||
|
}
|
|||
|
|
|||
|
void socket_callback::data_received()
|
|||
|
{
|
|||
|
data_->server()->dataCallback(data_);
|
|||
|
}
|