summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorThomas McGuire <thomas.mcguire.qnx@kdab.com>2012-09-24 12:25:49 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-09-26 20:45:20 +0200
commitb66b145633e19a7f70aade0943e0c8efb5169a59 (patch)
tree7effd30faa99b445d33dd625da8677ef89da391a /src/declarative
parentdff8dd6c31e81269b99004d9fb4127cd50a86fe4 (diff)
Include the signal code in the argument of (dis)connectNotify().
As it turns out, the convention of (dis)connectNotify() is to include the signal prefix, i.e. '2'. Therefore add this prefix also when calling these functions from QML. Also add a unit test confirming that the C++ and QML cases are now handled the same way. This patch is not needed in Qt5, as connectNotify() and disconnectNotify() take a QMetaMethod as a parameter, not a const char*. Change-Id: I3add0fc13c60a479949cf3d31218af5fd3f546a2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/qml/qdeclarativeboundsignal.cpp2
-rw-r--r--src/declarative/qml/qdeclarativenotifier_p.h2
-rw-r--r--src/declarative/qml/qdeclarativeproperty.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/declarative/qml/qdeclarativeboundsignal.cpp b/src/declarative/qml/qdeclarativeboundsignal.cpp
index c6ab1f1925..878f31e4ff 100644
--- a/src/declarative/qml/qdeclarativeboundsignal.cpp
+++ b/src/declarative/qml/qdeclarativeboundsignal.cpp
@@ -137,7 +137,7 @@ QDeclarativeBoundSignal::~QDeclarativeBoundSignal()
void QDeclarativeBoundSignal::disconnect()
{
QObjectPrivate * const priv = QObjectPrivate::get(m_scope);
- priv->disconnectNotify(m_signal.signature());
+ priv->disconnectNotify(QObjectPrivate::signalSignature(m_signal));
}
int QDeclarativeBoundSignal::index() const
diff --git a/src/declarative/qml/qdeclarativenotifier_p.h b/src/declarative/qml/qdeclarativenotifier_p.h
index ee80c9a2be..887d632506 100644
--- a/src/declarative/qml/qdeclarativenotifier_p.h
+++ b/src/declarative/qml/qdeclarativenotifier_p.h
@@ -217,7 +217,7 @@ void QDeclarativeNotifierEndpoint::disconnect()
QMetaObject::disconnectOne(s->source, s->sourceSignal, target, targetMethod);
QObjectPrivate * const priv = QObjectPrivate::get(s->source);
const QMetaMethod signal = s->source->metaObject()->method(s->sourceSignal);
- priv->disconnectNotify(signal.signature());
+ priv->disconnectNotify(QObjectPrivate::signalSignature(signal));
s->source = 0;
}
} else if (type == NotifierType) {
diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp
index 2867d27379..3c4c001c44 100644
--- a/src/declarative/qml/qdeclarativeproperty.cpp
+++ b/src/declarative/qml/qdeclarativeproperty.cpp
@@ -1635,7 +1635,7 @@ bool QDeclarativePropertyPrivate::connect(QObject *sender, int signal_index,
const QMetaMethod signal = sender->metaObject()->method(signal_index);
QObjectPrivate * const senderPriv = QObjectPrivate::get(sender);
- senderPriv->connectNotify(signal.signature());
+ senderPriv->connectNotify(QObjectPrivate::signalSignature(signal));
return QMetaObject::connect(sender, signal_index, receiver, method_index, type, types);
}