From 5e80eb7917c5b4d319766a3cf5122391f54c40a7 Mon Sep 17 00:00:00 2001 From: Debao Zhang Date: Fri, 23 Mar 2012 14:43:07 -0700 Subject: [PATCH] Remove AutoCompatConnection The default type when Qt 3 support is enabled. Same as AutoConnection but will also cause warnings to be output in certain situations. Change-Id: I64bf3c39a740afb716820bfd3173936fda213f4a Reviewed-by: Olivier Goffart Reviewed-by: Thiago Macieira Reviewed-by: Lars Knoll --- src/corelib/global/qnamespace.h | 1 - src/corelib/global/qnamespace.qdoc | 7 ------- src/corelib/kernel/qobject.cpp | 31 ++++-------------------------- 3 files changed, 4 insertions(+), 35 deletions(-) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 2a501dec7e4..cef244f7b36 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1193,7 +1193,6 @@ public: AutoConnection, DirectConnection, QueuedConnection, - AutoCompatConnection, BlockingQueuedConnection, UniqueConnection = 0x80 }; diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index d755e26e21a..771f9740111 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -537,13 +537,6 @@ same pair of objects, then the connection will fail. This connection type was introduced in Qt 4.6. - \value AutoCompatConnection - The default type when Qt 3 support is enabled. Same as - AutoConnection but will also cause warnings to be output in - certain situations. See \l{Porting to Qt 4#Compatibility - Signals and Slots}{Compatibility Signals and Slots} for - further information. - With queued connections, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index e41a7cf92ee..ad57362e1aa 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -2337,16 +2337,6 @@ QMetaObject::Connection QObject::connect(const QObject *sender, const char *sign const QObject *receiver, const char *method, Qt::ConnectionType type) { -#ifndef QT_NO_DEBUG - bool warnCompat = true; -#endif - if (type == Qt::AutoCompatConnection) { - type = Qt::AutoConnection; -#ifndef QT_NO_DEBUG - warnCompat = false; -#endif - } - if (sender == 0 || receiver == 0 || signal == 0 || method == 0) { qWarning("QObject::connect: Cannot connect %s::%s to %s::%s", sender ? sender->metaObject()->className() : "(null)", @@ -2455,11 +2445,9 @@ QMetaObject::Connection QObject::connect(const QObject *sender, const char *sign } #ifndef QT_NO_DEBUG - if (warnCompat) { - QMetaMethod smethod = smeta->method(signal_absolute_index); - QMetaMethod rmethod = rmeta->method(method_index_relative + rmeta->methodOffset()); - check_and_warn_compat(smeta, smethod, rmeta, rmethod); - } + QMetaMethod smethod = smeta->method(signal_absolute_index); + QMetaMethod rmethod = rmeta->method(method_index_relative + rmeta->methodOffset()); + check_and_warn_compat(smeta, smethod, rmeta, rmethod); #endif QMetaObject::Connection handle = QMetaObject::Connection(QMetaObjectPrivate::connect( sender, signal_index, receiver, method_index_relative, rmeta ,type, types)); @@ -2494,16 +2482,6 @@ QMetaObject::Connection QObject::connect(const QObject *sender, const QMetaMetho const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) { -#ifndef QT_NO_DEBUG - bool warnCompat = true; -#endif - if (type == Qt::AutoCompatConnection) { - type = Qt::AutoConnection; -#ifndef QT_NO_DEBUG - warnCompat = false; -#endif - } - if (sender == 0 || receiver == 0 || signal.methodType() != QMetaMethod::Signal @@ -2557,8 +2535,7 @@ QMetaObject::Connection QObject::connect(const QObject *sender, const QMetaMetho return QMetaObject::Connection(0); #ifndef QT_NO_DEBUG - if (warnCompat) - check_and_warn_compat(smeta, signal, rmeta, method); + check_and_warn_compat(smeta, signal, rmeta, method); #endif QMetaObject::Connection handle = QMetaObject::Connection(QMetaObjectPrivate::connect( sender, signal_index, receiver, method_index, 0, type, types));