initial commit
This commit is contained in:
commit
4b60ece582
327 changed files with 28286 additions and 0 deletions
33
lib/utils/signalcatcher.h
Normal file
33
lib/utils/signalcatcher.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
#ifndef SIGNALCATCHER_H
|
||||
#define SIGNALCATCHER_H
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QSocketNotifier>
|
||||
|
||||
namespace W
|
||||
{
|
||||
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