summaryrefslogtreecommitdiffstats
path: root/src/script/bridge/qscriptqobject.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2009-10-19 08:59:39 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2009-10-29 16:00:10 (GMT)
commite55810dc838e95c60a275f1ea3be3bb6bb93fb83 (patch)
treeb338015e25fdd2c87bbdee7d8600df0a6454d5c1 /src/script/bridge/qscriptqobject.cpp
parent7246b5a5942049b485bfdefbe133d7bb12165301 (diff)
downloadQt-e55810dc838e95c60a275f1ea3be3bb6bb93fb83.zip
Qt-e55810dc838e95c60a275f1ea3be3bb6bb93fb83.tar.gz
Qt-e55810dc838e95c60a275f1ea3be3bb6bb93fb83.tar.bz2
Fix QT_NO_PROPERTIES
However, there are some stuff added to qscript that I'm really not sure about. Reviewed-by: tom
Diffstat (limited to 'src/script/bridge/qscriptqobject.cpp')
-rw-r--r--src/script/bridge/qscriptqobject.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp
index 345489f..caf1018 100644
--- a/src/script/bridge/qscriptqobject.cpp
+++ b/src/script/bridge/qscriptqobject.cpp
@@ -1190,6 +1190,7 @@ bool QObjectDelegate::getOwnPropertySlot(QScriptObject *object, JSC::ExecState *
const JSC::Identifier &propertyName,
JSC::PropertySlot &slot)
{
+#ifndef QT_NO_PROPERTIES
QByteArray name = QString(propertyName.ustring()).toLatin1();
QObject *qobject = data->value;
if (!qobject) {
@@ -1296,12 +1297,16 @@ bool QObjectDelegate::getOwnPropertySlot(QScriptObject *object, JSC::ExecState *
}
return QScriptObjectDelegate::getOwnPropertySlot(object, exec, propertyName, slot);
+#else //QT_NO_PROPERTIES
+ return false;
+#endif //QT_NO_PROPERTIES
}
void QObjectDelegate::put(QScriptObject *object, JSC::ExecState* exec,
const JSC::Identifier& propertyName,
JSC::JSValue value, JSC::PutPropertySlot &slot)
{
+#ifndef QT_NO_PROPERTIES
QByteArray name = ((QString)propertyName.ustring()).toLatin1();
QObject *qobject = data->value;
if (!qobject) {
@@ -1392,12 +1397,14 @@ void QObjectDelegate::put(QScriptObject *object, JSC::ExecState* exec,
}
QScriptObjectDelegate::put(object, exec, propertyName, value, slot);
+#endif //QT_NO_PROPERTIES
}
bool QObjectDelegate::deleteProperty(QScriptObject *object, JSC::ExecState *exec,
const JSC::Identifier& propertyName,
bool checkDontDelete)
{
+#ifndef QT_NO_PROPERTIES
QByteArray name = ((QString)propertyName.ustring()).toLatin1();
QObject *qobject = data->value;
if (!qobject) {
@@ -1436,6 +1443,9 @@ bool QObjectDelegate::deleteProperty(QScriptObject *object, JSC::ExecState *exec
}
return QScriptObjectDelegate::deleteProperty(object, exec, propertyName, checkDontDelete);
+#else //QT_NO_PROPERTIES
+ return false;
+#endif //QT_NO_PROPERTIES
}
bool QObjectDelegate::getPropertyAttributes(const QScriptObject *object,
@@ -1443,6 +1453,7 @@ bool QObjectDelegate::getPropertyAttributes(const QScriptObject *object,
const JSC::Identifier &propertyName,
unsigned &attributes) const
{
+#ifndef QT_NO_PROPERTIES
// ### try to avoid duplicating logic from getOwnPropertySlot()
QByteArray name = ((QString)propertyName.ustring()).toLatin1();
QObject *qobject = data->value;
@@ -1511,12 +1522,16 @@ bool QObjectDelegate::getPropertyAttributes(const QScriptObject *object,
}
return QScriptObjectDelegate::getPropertyAttributes(object, exec, propertyName, attributes);
+#else //QT_NO_PROPERTIES
+ return false;
+#endif //QT_NO_PROPERTIES
}
void QObjectDelegate::getOwnPropertyNames(QScriptObject *object, JSC::ExecState *exec,
JSC::PropertyNameArray &propertyNames,
bool includeNonEnumerable)
{
+#ifndef QT_NO_PROPERTIES
QObject *qobject = data->value;
if (!qobject) {
QString message = QString::fromLatin1("cannot get property names of deleted QObject");
@@ -1560,6 +1575,7 @@ void QObjectDelegate::getOwnPropertyNames(QScriptObject *object, JSC::ExecState
}
QScriptObjectDelegate::getOwnPropertyNames(object, exec, propertyNames, includeNonEnumerable);
+#endif //QT_NO_PROPERTIES
}
void QObjectDelegate::markChildren(QScriptObject *object, JSC::MarkStack& markStack)