summaryrefslogtreecommitdiffstats
path: root/src/script/bridge
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2010-03-04 09:21:06 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2010-03-04 09:29:19 (GMT)
commitc7fec28e7b2f7192c6589c37f3db3e0b4ee85460 (patch)
treec4509f1ccdef275dac61254700d57c829cc1ed72 /src/script/bridge
parent9b60566af57543310a7b5bec03b5de1e24c7f746 (diff)
downloadQt-c7fec28e7b2f7192c6589c37f3db3e0b4ee85460.zip
Qt-c7fec28e7b2f7192c6589c37f3db3e0b4ee85460.tar.gz
Qt-c7fec28e7b2f7192c6589c37f3db3e0b4ee85460.tar.bz2
Fixes tst_QScriptExtQObject::connectAndDisconnect
Now that QVariant is known to QMetaType, it has an ID. This is much more robust as before. This would have fail if QVariant, would have been registered by the user. Reviewed-by: Kent Hansen
Diffstat (limited to 'src/script/bridge')
-rw-r--r--src/script/bridge/qscriptqobject.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp
index 8d111f9..39ba935 100644
--- a/src/script/bridge/qscriptqobject.cpp
+++ b/src/script/bridge/qscriptqobject.cpp
@@ -2174,14 +2174,12 @@ void QObjectConnectionManager::execute(int slotIndex, void **argv)
QByteArray typeName = parameterTypes.at(i);
int argType = QMetaType::type(parameterTypes.at(i));
if (!argType) {
- if (typeName == "QVariant") {
- actual = QScriptEnginePrivate::jscValueFromVariant(exec, *reinterpret_cast<QVariant*>(arg));
- } else {
- qWarning("QScriptEngine: Unable to handle unregistered datatype '%s' "
- "when invoking handler of signal %s::%s",
- typeName.constData(), meta->className(), method.signature());
- actual = JSC::jsUndefined();
- }
+ qWarning("QScriptEngine: Unable to handle unregistered datatype '%s' "
+ "when invoking handler of signal %s::%s",
+ typeName.constData(), meta->className(), method.signature());
+ actual = JSC::jsUndefined();
+ } else if (argType == QMetaType::QVariant) {
+ actual = QScriptEnginePrivate::jscValueFromVariant(exec, *reinterpret_cast<QVariant*>(arg));
} else {
actual = QScriptEnginePrivate::create(exec, argType, arg);
}