diff options
author | Rafael Roquetto <rafael.roquetto@kdab.com> | 2012-11-08 11:11:40 -0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-08 22:47:42 +0100 |
commit | 18553bc50de0bd3b34c4903ca21d108d22169936 (patch) | |
tree | 825de4527958ed5c1dab267412e806b8cf9ada79 /src | |
parent | acf959bee68d0dffc38770c045e47f7c4ccf348f (diff) |
Cleanup old signal handler mechanisms
Remove watchUnixSignal(), unixSignal() and associated code. These are relics
which were being used by QWS to detect virtual console switching. Currently
they are not being used at all. The recommended way to watch for Unix signals
in Qt is http://doc-snapshot.qt-project.org/5.0/unix-signals.html.
Change-Id: Id34207cb8853442302a45b2816356da0f973ebb1
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 13 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreapplication.h | 9 | ||||
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_unix.cpp | 45 |
3 files changed, 0 insertions, 67 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index cb744a67a6..507d83a9a4 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -2321,19 +2321,6 @@ void QCoreApplication::setEventDispatcher(QAbstractEventDispatcher *eventDispatc mainThread->setEventDispatcher(eventDispatcher); } -/* - \fn void QCoreApplication::watchUnixSignal(int signal, bool watch) - \internal -*/ - -/*! - \fn void QCoreApplication::unixSignal(int number) - \internal - - This signal is emitted whenever a Unix signal is received by the - application. The Unix signal received is specified by its \a number. -*/ - /*! \fn void qAddPostRoutine(QtCleanUpFunction ptr) \relates QCoreApplication diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h index b65f0cd314..94b0566ca0 100644 --- a/src/corelib/kernel/qcoreapplication.h +++ b/src/corelib/kernel/qcoreapplication.h @@ -156,10 +156,6 @@ public: static void flush(); -#if defined(Q_OS_UNIX) - static void watchUnixSignal(int signal, bool watch); -#endif - void installNativeEventFilter(QAbstractNativeEventFilter *filterObj); void removeNativeEventFilter(QAbstractNativeEventFilter *filterObj); @@ -175,11 +171,6 @@ Q_SIGNALS: QPrivateSignal #endif ); - void unixSignal(int -#if !defined(qdoc) - , QPrivateSignal -#endif - ); protected: bool event(QEvent *); diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp index 6c2a610a56..995f5101cb 100644 --- a/src/corelib/kernel/qeventdispatcher_unix.cpp +++ b/src/corelib/kernel/qeventdispatcher_unix.cpp @@ -72,20 +72,6 @@ QT_BEGIN_NAMESPACE -/***************************************************************************** - UNIX signal handling - *****************************************************************************/ - -static sig_atomic_t signal_received; -static sig_atomic_t signals_fired[NSIG]; - -static void signalHandler(int sig) -{ - signals_fired[sig] = 1; - signal_received = 1; -} - - #if defined(Q_OS_INTEGRITY) || defined(Q_OS_VXWORKS) static void initThreadPipeFD(int fd) { @@ -185,18 +171,6 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags, int nsel; do { - if (mainThread) { - while (signal_received) { - signal_received = 0; - for (int i = 0; i < NSIG; ++i) { - if (signals_fired[i]) { - signals_fired[i] = 0; - emit QCoreApplication::instance()->unixSignal(i, QCoreApplication::QPrivateSignal()); - } - } - } - } - // Process timers and socket notifiers - the common UNIX stuff int highest = 0; if (! (flags & QEventLoop::ExcludeSocketNotifiers) && (sn_highest >= 0)) { @@ -671,23 +645,4 @@ void QEventDispatcherUNIX::interrupt() void QEventDispatcherUNIX::flush() { } - - -/*! - \internal -*/ -void QCoreApplication::watchUnixSignal(int sig, bool watch) -{ - if (sig < NSIG) { - struct sigaction sa; - sigemptyset(&(sa.sa_mask)); - sa.sa_flags = 0; - if (watch) - sa.sa_handler = signalHandler; - else - sa.sa_handler = SIG_DFL; - sigaction(sig, &sa, 0); - } -} - QT_END_NAMESPACE |