Remove v8 usage in a few places
authorLars Knoll <lars.knoll@digia.com>
Wed, 5 Jun 2013 23:16:49 +0000 (01:16 +0200)
committerSimon Hausmann <simon.hausmann@digia.com>
Thu, 6 Jun 2013 06:04:40 +0000 (08:04 +0200)
Change-Id: Ib9885d395dd799c0f9dc68e16efea44b60cb1418
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/quick/items/qquickloader.cpp
src/quick/items/qquickloader_p_p.h
src/quick/items/qquicktextinput.cpp

index 8a59795..f3f428c 100644 (file)
@@ -571,15 +571,15 @@ void QQuickLoader::setSource(QQmlV4Function *args)
 
     bool ipvError = false;
     args->setReturnValue(QV4::Value::undefinedValue());
-    v8::Handle<v8::Object> ipv = d->extractInitialPropertyValues(args, this, &ipvError);
+    QV4::Value ipv = d->extractInitialPropertyValues(args, this, &ipvError);
     if (ipvError)
         return;
 
     d->clear();
     QUrl sourceUrl = d->resolveSourceUrl(args);
-    if (!ipv.IsEmpty()) {
+    if (!ipv.isEmpty()) {
         d->disposeInitialPropertyValues();
-        d->initialPropertyValues = ipv->v4Value();
+        d->initialPropertyValues = ipv;
         d->qmlGlobalForIpv = args->qmlGlobal();
     }
 
@@ -933,17 +933,17 @@ QUrl QQuickLoaderPrivate::resolveSourceUrl(QQmlV4Function *args)
     return context->resolvedUrl(QUrl(arg));
 }
 
-v8::Handle<v8::Object> QQuickLoaderPrivate::extractInitialPropertyValues(QQmlV4Function *args, QObject *loader, bool *error)
+QV4::Value QQuickLoaderPrivate::extractInitialPropertyValues(QQmlV4Function *args, QObject *loader, bool *error)
 {
-    v8::Handle<v8::Object> valuemap;
+    QV4::Value valuemap = QV4::Value::emptyValue();
     if (args->length() >= 2) {
-        v8::Handle<v8::Value> v = (*args)[1];
-        if (!v->IsObject() || v->IsArray()) {
+        QV4::Value v = (*args)[1];
+        if (!v.isObject() || v.asArrayObject()) {
             *error = true;
             qmlInfo(loader) << QQuickLoader::tr("setSource: value is not an object");
         } else {
             *error = false;
-            valuemap = v8::Handle<v8::Object>::Cast(v);
+            valuemap = v;
         }
     }
 
index 82b78ed..0f3bdc8 100644 (file)
@@ -99,7 +99,7 @@ public:
     void setInitialState(QObject *o);
     void disposeInitialPropertyValues();
     QUrl resolveSourceUrl(QQmlV4Function *args);
-    v8::Handle<v8::Object> extractInitialPropertyValues(QQmlV4Function *args, QObject *loader, bool *error);
+    QV4::Value extractInitialPropertyValues(QQmlV4Function *args, QObject *loader, bool *error);
 
     virtual qreal getImplicitWidth() const;
     virtual qreal getImplicitHeight() const;
index 5e1b786..989c0db 100644 (file)
@@ -1411,17 +1411,17 @@ void QQuickTextInput::positionAt(QQmlV4Function *args) const
         return;
 
     int i = 0;
-    v8::Handle<v8::Value> arg = (*args)[i];
-    x = arg->NumberValue();
+    QV4::Value arg = (*args)[i];
+    x = arg.toNumber();
 
     if (++i < args->length()) {
         arg = (*args)[i];
-        y = arg->NumberValue();
+        y = arg.toNumber();
     }
 
     if (++i < args->length()) {
         arg = (*args)[i];
-        position = QTextLine::CursorPosition(arg->Int32Value());
+        position = QTextLine::CursorPosition(arg.toInt32());
     }
 
     int pos = d->positionAt(x, y, position);