]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/socket_callback.cpp
* src/frontends/qt4/ui/TextLayoutUi.ui:
[lyx.git] / src / frontends / qt4 / socket_callback.cpp
1 /**
2  * \file io_callback.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author unknown
7  * \author John Levon
8  * \author João Luis M. Assirati
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #include <config.h>
14
15 #include "socket_callback.h"
16
17
18 namespace lyx {
19
20 socket_callback::socket_callback(int fd, boost::function<void()> func)
21         : func_(func)
22 {
23         sn_.reset(new QSocketNotifier(fd, QSocketNotifier::Read, this));
24         connect(sn_.get(), SIGNAL(activated(int)), this, SLOT(data_received()));
25 }
26
27
28 void socket_callback::data_received()
29 {
30         func_();
31 }
32
33 } // namespace lyx
34
35 #include "socket_callback_moc.cpp"