summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlengine.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-11-06 02:44:19 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-11-06 02:44:19 (GMT)
commit8e94e7d95f7fbc142a1a5faf3347aa165ff2426e (patch)
treefec7142714ee52afcb19e41fc1d66d787e6d4c09 /src/declarative/qml/qmlengine.cpp
parentbce122040d2df5ae650e6de17d41568f1ba7c184 (diff)
downloadQt-8e94e7d95f7fbc142a1a5faf3347aa165ff2426e.zip
Qt-8e94e7d95f7fbc142a1a5faf3347aa165ff2426e.tar.gz
Qt-8e94e7d95f7fbc142a1a5faf3347aa165ff2426e.tar.bz2
Update valuetype tests
Add a new test, and make the old variantCopy pass
Diffstat (limited to 'src/declarative/qml/qmlengine.cpp')
-rw-r--r--src/declarative/qml/qmlengine.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp
index e46205d..177818f 100644
--- a/src/declarative/qml/qmlengine.cpp
+++ b/src/declarative/qml/qmlengine.cpp
@@ -908,7 +908,7 @@ QVariant QmlEnginePrivate::scriptValueToVariant(const QScriptValue &val)
else if (dc == contextClass)
return QVariant();
- QScriptClass *sc = val.scriptClass();
+ QScriptDeclarativeClass *sc = QScriptDeclarativeClass::scriptClass(val);
if (!sc) {
return val.toVariant();
} else if (sc == valueTypeClass) {
@@ -929,20 +929,7 @@ QVariant QmlScriptClass::toVariant(QmlEngine *engine, const QScriptValue &val)
QmlEnginePrivate *ep =
static_cast<QmlEnginePrivate *>(QObjectPrivate::get(engine));
- QScriptDeclarativeClass *dc = QScriptDeclarativeClass::scriptClass(val);
- if (dc == ep->objectClass)
- return QVariant::fromValue(ep->objectClass->toQObject(val));
- else if (dc == ep->contextClass)
- return QVariant();
-
- QScriptClass *sc = val.scriptClass();
- if (!sc) {
- return val.toVariant();
- } else if (sc == ep->valueTypeClass) {
- return ep->valueTypeClass->toVariant(val);
- }
-
- return QVariant();
+ return ep->scriptValueToVariant(val);
}
// XXX this beyonds in QUrl::toLocalFile()