]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/socket_callback.C
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / qt4 / socket_callback.C
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 socket_callback::socket_callback(int fd, boost::function<void()> func)
19         : func_(func)
20 {
21         sn_.reset(new QSocketNotifier(fd, QSocketNotifier::Read, this));
22         connect(sn_.get(), SIGNAL(activated(int)), this, SLOT(data_received()));
23 }
24
25
26 void socket_callback::data_received()
27 {
28         func_();
29 }
30
31 #include "socket_callback_moc.cpp"