mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 16:44:48 -07:00
Servatrice: refactor signal handling and permit config reloading
This commit is contained in:
parent
9947af7be9
commit
6cf3db7e6b
12 changed files with 163 additions and 95 deletions
|
|
@ -7,7 +7,6 @@
|
|||
#include <QWaitCondition>
|
||||
#include <QStringList>
|
||||
|
||||
class QSocketNotifier;
|
||||
class QFile;
|
||||
class Server_ProtocolHandler;
|
||||
|
||||
|
|
@ -16,19 +15,16 @@ class ServerLogger : public QObject {
|
|||
public:
|
||||
ServerLogger(bool _logToConsole, QObject *parent = 0);
|
||||
~ServerLogger();
|
||||
static void hupSignalHandler(int unused);
|
||||
public slots:
|
||||
void startLog(const QString &logFileName);
|
||||
void logMessage(QString message, void *caller = 0);
|
||||
void rotateLogs();
|
||||
private slots:
|
||||
void handleSigHup();
|
||||
void flushBuffer();
|
||||
signals:
|
||||
void sigFlushBuffer();
|
||||
private:
|
||||
bool logToConsole;
|
||||
static int sigHupFD[2];
|
||||
QSocketNotifier *snHup;
|
||||
static QFile *logFile;
|
||||
bool flushRunning;
|
||||
QStringList buffer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue