forked from blue/squawk
Accounts saving, tree status, sigint catching
This commit is contained in:
parent
d4afdd7a5f
commit
4a4ba47968
11 changed files with 251 additions and 15 deletions
30
signalcatcher.h
Normal file
30
signalcatcher.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
#ifndef SIGNALCATCHER_H
|
||||
#define SIGNALCATCHER_H
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QSocketNotifier>
|
||||
|
||||
class SignalCatcher: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SignalCatcher(QCoreApplication *p_app, QObject *parent = 0);
|
||||
~SignalCatcher();
|
||||
|
||||
static void intSignalHandler(int unused);
|
||||
|
||||
public slots:
|
||||
void handleSigInt();
|
||||
|
||||
private:
|
||||
QCoreApplication *app;
|
||||
static int sigintFd[2];
|
||||
|
||||
QSocketNotifier *snInt;
|
||||
|
||||
static int setup_unix_signal_handlers();
|
||||
};
|
||||
|
||||
#endif // SIGNALCATCHER_H
|
Loading…
Add table
Add a link
Reference in a new issue