Don't compare the target methods for SlotObject connections

When a new-style connection is created (a SlotObject), we don't store
the method offset since there isn't one. So don't try to read it.

Qt::UniqueConnection only applies to old-style connections, since we
can't compare the slot objects for equality. In any case, an old-style
connection and a new style will never be considered equal.

Task-number: QTBUG-39927
Change-Id: I10a39a7bc97a2ec9509a0708038cc491bcc67329
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Elias Probst <mail@eliasprobst.eu>
This commit is contained in:
Thiago Macieira 2014-06-28 13:06:08 -07:00
parent 5d6b763ee5
commit 86fa23b5e3

View File

@ -3230,7 +3230,7 @@ QObjectPrivate::Connection *QMetaObjectPrivate::connect(const QObject *sender,
int method_index_absolute = method_index + method_offset;
while (c2) {
if (c2->receiver == receiver && c2->method() == method_index_absolute)
if (!c2->isSlotObject && c2->receiver == receiver && c2->method() == method_index_absolute)
return 0;
c2 = c2->nextConnectionList;
}