diff options
-rw-r--r-- | src/corelib/kernel/qsocketnotifier.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/corelib/kernel/qsocketnotifier.cpp b/src/corelib/kernel/qsocketnotifier.cpp index 97cfd34..2f2dec8 100644 --- a/src/corelib/kernel/qsocketnotifier.cpp +++ b/src/corelib/kernel/qsocketnotifier.cpp @@ -171,18 +171,17 @@ QT_BEGIN_NAMESPACE QSocketNotifier::QSocketNotifier(int socket, Type type, QObject *parent) : QObject(parent) { - if (socket < 0) - qWarning("QSocketNotifier: Invalid socket specified"); sockfd = socket; sntype = type; snenabled = true; Q_D(QObject); - if (!d->threadData->eventDispatcher) { + if (socket < 0) + qWarning("QSocketNotifier: Invalid socket specified"); + else if (!d->threadData->eventDispatcher) qWarning("QSocketNotifier: Can only be used with threads started with QThread"); - } else { + else d->threadData->eventDispatcher->registerSocketNotifier(this); - } } #ifdef QT3_SUPPORT |