summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-07-02 03:40:10 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-07-02 03:40:10 (GMT)
commitfcfeee14047b87eeb4de49188a997fbfeed73773 (patch)
tree8e5f732783a90b2187728f5e955efb11304a420c /src/script
parent8aba610c22c44bf36eb2e539a06b65753c48bbc2 (diff)
parent6c9647f6673fd5738001c5bbe416b116442fbc41 (diff)
downloadQt-fcfeee14047b87eeb4de49188a997fbfeed73773.zip
Qt-fcfeee14047b87eeb4de49188a997fbfeed73773.tar.gz
Qt-fcfeee14047b87eeb4de49188a997fbfeed73773.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into kinetic-declarativeui
Conflicts: configure.exe src/gui/kernel/qevent.cpp src/gui/kernel/qevent_p.h tools/qdoc3/codemarker.cpp tools/qdoc3/cppcodemarker.cpp tools/qdoc3/generator.cpp
Diffstat (limited to 'src/script')
-rw-r--r--src/script/qscriptecmafunction.cpp2
-rw-r--r--src/script/qscriptecmaglobal.cpp3
-rw-r--r--src/script/qscriptengine.cpp3
-rw-r--r--src/script/qscriptengine_p.cpp15
-rw-r--r--src/script/qscriptenginefwd_p.h9
-rw-r--r--src/script/qscriptextqobject.cpp19
-rw-r--r--src/script/qscriptextqobject_p.h3
7 files changed, 32 insertions, 22 deletions
diff --git a/src/script/qscriptecmafunction.cpp b/src/script/qscriptecmafunction.cpp
index 87b0639..0bb5f12 100644
--- a/src/script/qscriptecmafunction.cpp
+++ b/src/script/qscriptecmafunction.cpp
@@ -436,7 +436,7 @@ QScriptValueImpl Function::method_connect(QScriptContextPrivate *context, QScrip
QLatin1String("Function.prototype.connect: target is not a function"));
}
- bool ok = eng->scriptConnect(self, receiver, slot);
+ bool ok = eng->scriptConnect(self, receiver, slot, Qt::AutoConnection);
if (!ok) {
return context->throwError(
QString::fromLatin1("Function.prototype.connect: failed to connect to %0::%1")
diff --git a/src/script/qscriptecmaglobal.cpp b/src/script/qscriptecmaglobal.cpp
index a7cb115..b756a27 100644
--- a/src/script/qscriptecmaglobal.cpp
+++ b/src/script/qscriptecmaglobal.cpp
@@ -305,8 +305,7 @@ public:
}
if (context->state() != QScriptContext::ExceptionState) {
- QTextStream qout(stdout, QIODevice::WriteOnly);
- qout << result << endl;
+ qDebug(qPrintable(result));
context->setReturnValue(eng->undefinedValue());
}
#ifndef Q_SCRIPT_NO_EVENT_NOTIFY
diff --git a/src/script/qscriptengine.cpp b/src/script/qscriptengine.cpp
index de8bd8d..de78403 100644
--- a/src/script/qscriptengine.cpp
+++ b/src/script/qscriptengine.cpp
@@ -1616,7 +1616,8 @@ bool qScriptConnect(QObject *sender, const char *signal,
QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(function.engine());
return eng_p->scriptConnect(sender, signal,
eng_p->toImpl(receiver),
- eng_p->toImpl(function));
+ eng_p->toImpl(function),
+ Qt::AutoConnection);
}
/*!
diff --git a/src/script/qscriptengine_p.cpp b/src/script/qscriptengine_p.cpp
index 0a238bc..ffb5a27 100644
--- a/src/script/qscriptengine_p.cpp
+++ b/src/script/qscriptengine_p.cpp
@@ -2312,7 +2312,8 @@ void QScriptEnginePrivate::deletePendingQObjects()
bool QScriptEnginePrivate::scriptConnect(QObject *sender, const char *signal,
const QScriptValueImpl &receiver,
- const QScriptValueImpl &function)
+ const QScriptValueImpl &function,
+ Qt::ConnectionType type)
{
Q_ASSERT(sender);
Q_ASSERT(signal);
@@ -2320,7 +2321,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);
+ return scriptConnect(sender, index, receiver, function, /*wrapper=*/QScriptValueImpl(), type);
}
bool QScriptEnginePrivate::scriptDisconnect(QObject *sender, const char *signal,
@@ -2339,10 +2340,11 @@ bool QScriptEnginePrivate::scriptDisconnect(QObject *sender, const char *signal,
bool QScriptEnginePrivate::scriptConnect(QObject *sender, int signalIndex,
const QScriptValueImpl &receiver,
const QScriptValueImpl &function,
- const QScriptValueImpl &senderWrapper)
+ const QScriptValueImpl &senderWrapper,
+ Qt::ConnectionType type)
{
QScriptQObjectData *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,
@@ -2357,11 +2359,12 @@ bool QScriptEnginePrivate::scriptDisconnect(QObject *sender, int signalIndex,
bool QScriptEnginePrivate::scriptConnect(const QScriptValueImpl &signal,
const QScriptValueImpl &receiver,
- const QScriptValueImpl &function)
+ const QScriptValueImpl &function,
+ Qt::ConnectionType type)
{
QScript::QtFunction *fun = static_cast<QScript::QtFunction*>(signal.toFunction());
int index = fun->mostGeneralMethod();
- return scriptConnect(fun->qobject(), index, receiver, function, fun->object());
+ return scriptConnect(fun->qobject(), index, receiver, function, fun->object(), type);
}
bool QScriptEnginePrivate::scriptDisconnect(const QScriptValueImpl &signal,
diff --git a/src/script/qscriptenginefwd_p.h b/src/script/qscriptenginefwd_p.h
index 11cd839..62942a5 100644
--- a/src/script/qscriptenginefwd_p.h
+++ b/src/script/qscriptenginefwd_p.h
@@ -385,7 +385,8 @@ public:
bool scriptConnect(QObject *sender, const char *signal,
const QScriptValueImpl &receiver,
- const QScriptValueImpl &function);
+ const QScriptValueImpl &function,
+ Qt::ConnectionType type);
bool scriptDisconnect(QObject *sender, const char *signal,
const QScriptValueImpl &receiver,
const QScriptValueImpl &function);
@@ -393,14 +394,16 @@ public:
bool scriptConnect(QObject *sender, int index,
const QScriptValueImpl &receiver,
const QScriptValueImpl &function,
- const QScriptValueImpl &senderWrapper = QScriptValueImpl());
+ const QScriptValueImpl &senderWrapper,
+ Qt::ConnectionType type);
bool scriptDisconnect(QObject *sender, int index,
const QScriptValueImpl &receiver,
const QScriptValueImpl &function);
bool scriptConnect(const QScriptValueImpl &signal,
const QScriptValueImpl &receiver,
- const QScriptValueImpl &function);
+ const QScriptValueImpl &function,
+ Qt::ConnectionType type);
bool scriptDisconnect(const QScriptValueImpl &signal,
const QScriptValueImpl &receiver,
const QScriptValueImpl &function);
diff --git a/src/script/qscriptextqobject.cpp b/src/script/qscriptextqobject.cpp
index eeb2d51..3ea5963 100644
--- a/src/script/qscriptextqobject.cpp
+++ b/src/script/qscriptextqobject.cpp
@@ -1420,7 +1420,8 @@ public:
bool addSignalHandler(QObject *sender, int signalIndex,
const QScriptValueImpl &receiver,
const QScriptValueImpl &slot,
- const QScriptValueImpl &senderWrapper = QScriptValueImpl());
+ const QScriptValueImpl &senderWrapper,
+ Qt::ConnectionType type);
bool removeSignalHandler(
QObject *sender, int signalIndex,
const QScriptValueImpl &receiver,
@@ -1741,13 +1742,14 @@ void QScript::QObjectConnectionManager::mark(int generation)
bool QScript::QObjectConnectionManager::addSignalHandler(
QObject *sender, int signalIndex, const QScriptValueImpl &receiver,
- const QScriptValueImpl &function, const QScriptValueImpl &senderWrapper)
+ const QScriptValueImpl &function, const QScriptValueImpl &senderWrapper,
+ Qt::ConnectionType type)
{
if (connections.size() <= signalIndex)
connections.resize(signalIndex+1);
QVector<QObjectConnection> &cs = connections[signalIndex];
int absSlotIndex = m_slotCounter + metaObject()->methodOffset();
- bool ok = QMetaObject::connect(sender, signalIndex, this, absSlotIndex);
+ bool ok = QMetaObject::connect(sender, signalIndex, this, absSlotIndex, type);
if (ok) {
cs.append(QScript::QObjectConnection(m_slotCounter++, receiver, function, senderWrapper));
QMetaMethod signal = sender->metaObject()->method(signalIndex);
@@ -2051,12 +2053,12 @@ bool ExtQMetaObjectData::resolve(const QScriptValueImpl &object,
for (int i = 0; i < meta->enumeratorCount(); ++i) {
QMetaEnum e = meta->enumerator(i);
-
for (int j = 0; j < e.keyCount(); ++j) {
const char *key = e.key(j);
-
if (! qstrcmp (key, name.constData())) {
- member->native(nameId, e.value(j), QScriptValue::ReadOnly);
+ member->native(nameId, e.value(j),
+ QScriptValue::ReadOnly
+ | QScriptValue::Undeletable);
*base = object;
return true;
}
@@ -2176,12 +2178,13 @@ bool QScriptQObjectData::addSignalHandler(QObject *sender,
int signalIndex,
const QScriptValueImpl &receiver,
const QScriptValueImpl &slot,
- const QScriptValueImpl &senderWrapper)
+ const QScriptValueImpl &senderWrapper,
+ Qt::ConnectionType type)
{
if (!m_connectionManager)
m_connectionManager = new QScript::QObjectConnectionManager();
return m_connectionManager->addSignalHandler(
- sender, signalIndex, receiver, slot, senderWrapper);
+ sender, signalIndex, receiver, slot, senderWrapper, type);
}
bool QScriptQObjectData::removeSignalHandler(QObject *sender,
diff --git a/src/script/qscriptextqobject_p.h b/src/script/qscriptextqobject_p.h
index 764644f..8f10823 100644
--- a/src/script/qscriptextqobject_p.h
+++ b/src/script/qscriptextqobject_p.h
@@ -216,7 +216,8 @@ public:
int signalIndex,
const QScriptValueImpl &receiver,
const QScriptValueImpl &slot,
- const QScriptValueImpl &senderWrapper = QScriptValueImpl());
+ const QScriptValueImpl &senderWrapper,
+ Qt::ConnectionType type);
bool removeSignalHandler(QObject *sender,
int signalIndex,
const QScriptValueImpl &receiver,