summaryrefslogtreecommitdiffstats
path: root/src/script/api
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-08-06 12:13:21 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-08-06 12:13:21 (GMT)
commitbc83b5856416e5927822ee3e758d231fc9f43c38 (patch)
tree4992a1b11637fd2cb94613d5d2a53238acf9f8b4 /src/script/api
parent319a6c0da5461c18537979e5df850db87765d302 (diff)
downloadQt-bc83b5856416e5927822ee3e758d231fc9f43c38.zip
Qt-bc83b5856416e5927822ee3e758d231fc9f43c38.tar.gz
Qt-bc83b5856416e5927822ee3e758d231fc9f43c38.tar.bz2
port commit 47c9e7b1b3551ff6dbe71590461a45ae398a9501 from qt/master
Diffstat (limited to 'src/script/api')
-rw-r--r--src/script/api/qscriptengine.cpp19
-rw-r--r--src/script/api/qscriptengine_p.h8
2 files changed, 16 insertions, 11 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 9abc5da..36f0f44 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -611,7 +611,7 @@ JSC::JSValue functionConnect(JSC::ExecState *exec, JSC::JSObject */*callee*/, JS
return JSC::throwError(exec, JSC::TypeError, "Function.prototype.connect: target is not a function");
}
- bool ok = engine->scriptConnect(thisObject, receiver, slot);
+ bool ok = engine->scriptConnect(thisObject, receiver, slot, Qt::AutoConnection);
if (!ok) {
QString message = QString::fromLatin1("Function.prototype.connect: failed to connect to %0::%1")
.arg(QLatin1String(qtSignal->metaObject()->className()))
@@ -1273,7 +1273,8 @@ void QScriptEnginePrivate::emitSignalHandlerException()
}
bool QScriptEnginePrivate::scriptConnect(QObject *sender, const char *signal,
- JSC::JSValue receiver, JSC::JSValue function)
+ JSC::JSValue receiver, JSC::JSValue function,
+ Qt::ConnectionType type)
{
Q_ASSERT(sender);
Q_ASSERT(signal);
@@ -1281,7 +1282,7 @@ bool QScriptEnginePrivate::scriptConnect(QObject *sender, const char *signal,
int index = meta->indexOfSignal(QMetaObject::normalizedSignature(signal+1));
if (index == -1)
return false;
- return scriptConnect(sender, index, receiver, function, /*wrapper=*/JSC::JSValue());
+ return scriptConnect(sender, index, receiver, function, /*wrapper=*/JSC::JSValue(), type);
}
bool QScriptEnginePrivate::scriptDisconnect(QObject *sender, const char *signal,
@@ -1298,10 +1299,11 @@ bool QScriptEnginePrivate::scriptDisconnect(QObject *sender, const char *signal,
bool QScriptEnginePrivate::scriptConnect(QObject *sender, int signalIndex,
JSC::JSValue receiver, JSC::JSValue function,
- JSC::JSValue senderWrapper)
+ JSC::JSValue senderWrapper,
+ Qt::ConnectionType type)
{
QScript::QObjectData *data = qobjectData(sender);
- return data->addSignalHandler(sender, signalIndex, receiver, function, senderWrapper);
+ return data->addSignalHandler(sender, signalIndex, receiver, function, senderWrapper, type);
}
bool QScriptEnginePrivate::scriptDisconnect(QObject *sender, int signalIndex,
@@ -1314,11 +1316,11 @@ bool QScriptEnginePrivate::scriptDisconnect(QObject *sender, int signalIndex,
}
bool QScriptEnginePrivate::scriptConnect(JSC::JSValue signal, JSC::JSValue receiver,
- JSC::JSValue function)
+ JSC::JSValue function, Qt::ConnectionType type)
{
QScript::QtFunction *fun = static_cast<QScript::QtFunction*>(JSC::asObject(signal));
int index = fun->mostGeneralMethod();
- return scriptConnect(fun->qobject(), index, receiver, function, fun->wrapperObject());
+ return scriptConnect(fun->qobject(), index, receiver, function, fun->wrapperObject(), type);
}
bool QScriptEnginePrivate::scriptDisconnect(JSC::JSValue signal, JSC::JSValue receiver,
@@ -3453,7 +3455,8 @@ bool qScriptConnect(QObject *sender, const char *signal,
QScriptEnginePrivate *engine = QScriptEnginePrivate::get(function.engine());
JSC::JSValue jscReceiver = engine->scriptValueToJSCValue(receiver);
JSC::JSValue jscFunction = engine->scriptValueToJSCValue(function);
- return engine->scriptConnect(sender, signal, jscReceiver, jscFunction);
+ return engine->scriptConnect(sender, signal, jscReceiver, jscFunction,
+ Qt::AutoConnection);
}
/*!
diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h
index 614341b..77c4561 100644
--- a/src/script/api/qscriptengine_p.h
+++ b/src/script/api/qscriptengine_p.h
@@ -178,18 +178,20 @@ public:
void emitSignalHandlerException();
bool scriptConnect(QObject *sender, const char *signal,
- JSC::JSValue receiver, JSC::JSValue function);
+ JSC::JSValue receiver, JSC::JSValue function,
+ Qt::ConnectionType type);
bool scriptDisconnect(QObject *sender, const char *signal,
JSC::JSValue receiver, JSC::JSValue function);
bool scriptConnect(QObject *sender, int index,
JSC::JSValue receiver, JSC::JSValue function,
- JSC::JSValue senderWrapper = 0);
+ JSC::JSValue senderWrapper,
+ Qt::ConnectionType type);
bool scriptDisconnect(QObject *sender, int index,
JSC::JSValue receiver, JSC::JSValue function);
bool scriptConnect(JSC::JSValue signal, JSC::JSValue receiver,
- JSC::JSValue function);
+ JSC::JSValue function, Qt::ConnectionType type);
bool scriptDisconnect(JSC::JSValue signal, JSC::JSValue receiver,
JSC::JSValue function);