mirror of
https://github.com/YACReader/yacreader
synced 2025-07-14 02:54:46 -04:00
Headless server: simplify system config logger
This commit is contained in:
50
YACReaderLibrary/yacreader_local_server.h
Normal file
50
YACReaderLibrary/yacreader_local_server.h
Normal file
@ -0,0 +1,50 @@
|
||||
#ifndef YACREADER_LOCAL_SERVER_H
|
||||
#define YACREADER_LOCAL_SERVER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QThread>
|
||||
#include <QMutex>
|
||||
|
||||
class QLocalServer;
|
||||
class QLocalSocket;
|
||||
class ComicDB;
|
||||
|
||||
class YACReaderLocalServer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit YACReaderLocalServer(QObject *parent = 0);
|
||||
|
||||
signals:
|
||||
void comicUpdated(quint64 libraryId, const ComicDB & comic);
|
||||
public slots:
|
||||
bool isListening();
|
||||
void sendResponse();
|
||||
static bool isRunning();
|
||||
void close();
|
||||
private:
|
||||
//void run();
|
||||
QLocalServer * localServer;
|
||||
|
||||
};
|
||||
|
||||
class YACReaderClientConnectionWorker : public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
YACReaderClientConnectionWorker( QLocalSocket *clientConnection);
|
||||
~YACReaderClientConnectionWorker();
|
||||
signals:
|
||||
void comicUpdated(quint64 libraryId, const ComicDB & comic);
|
||||
private:
|
||||
static QMutex dbMutex;
|
||||
//static int count;
|
||||
void run();
|
||||
|
||||
void getComicInfo(quint64 libraryId, ComicDB & comic, QList<ComicDB> & sibling);
|
||||
void updateComic(quint64 libraryId, ComicDB & comic);
|
||||
|
||||
QLocalSocket *clientConnection;
|
||||
};
|
||||
|
||||
#endif // YACREADER_LOCAL_SERVER_H
|
Reference in New Issue
Block a user