local server now runs in a separated thread

This commit is contained in:
Luis Ángel San Martín
2013-08-24 23:25:13 +02:00
parent b684b580ed
commit c96950584f
6 changed files with 20 additions and 5 deletions

View File

@ -12,7 +12,7 @@
using namespace YACReader;
YACReaderLocalServer::YACReaderLocalServer(QObject *parent) :
QObject(parent)
QThread(parent)
{
localServer = new QLocalServer(this);
if (!localServer->listen(YACREADERLIBRARY_GUID)) {
@ -27,6 +27,12 @@ bool YACReaderLocalServer::isListening()
return localServer->isListening();
}
void YACReaderLocalServer::run()
{
while(1)
exec();
}
void YACReaderLocalServer::sendResponse()
{
QLocalSocket *clientConnection = localServer->nextPendingConnection();