summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine.cpp
diff options
context:
space:
mode:
authorJedrzej Nowacki <jedrzej.nowacki@nokia.com>2009-08-19 08:12:51 (GMT)
committerJedrzej Nowacki <jedrzej.nowacki@nokia.com>2009-08-19 08:29:54 (GMT)
commit72ae891ec6b1798904962e15b36b506f5b850761 (patch)
tree5dd09b4e7d87c057df643a6cdaf6305dc9371083 /src/script/api/qscriptengine.cpp
parente43e54a357adcb32a7e13e9a1efb9deaa76a1d26 (diff)
downloadQt-72ae891ec6b1798904962e15b36b506f5b850761.zip
Qt-72ae891ec6b1798904962e15b36b506f5b850761.tar.gz
Qt-72ae891ec6b1798904962e15b36b506f5b850761.tar.bz2
Clean up.
Internal API of QScriptValue were cleaned. toPublic() was removed and replaced by standard static Private::get(). All initFromXXX() methods were replaced by overload call of initFrom(). Reviewed-by: Kent Hansen
Diffstat (limited to 'src/script/api/qscriptengine.cpp')
-rw-r--r--src/script/api/qscriptengine.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 02293ea..e5eaafb 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -849,9 +849,12 @@ QScriptValue QScriptEnginePrivate::scriptValueFromJSCValue(JSC::JSValue value)
Q_Q(QScriptEngine);
if (!value)
return QScriptValue();
- QScriptValue result;
- QScriptValuePrivate::initFromJSCValue(result, q, value);
- return result;
+
+ QScriptValuePrivate *p_value = new QScriptValuePrivate();
+ p_value->engine = q;
+ p_value->initFrom(value);
+
+ return QScriptValuePrivate::get(p_value);
}
JSC::JSValue QScriptEnginePrivate::scriptValueToJSCValue(const QScriptValue &value)
@@ -864,9 +867,9 @@ JSC::JSValue QScriptEnginePrivate::scriptValueToJSCValue(const QScriptValue &val
Q_ASSERT(!vv->engine || vv->engine == q);
vv->engine = q;
if (vv->type == QScriptValuePrivate::Number) {
- vv->initFromJSCValue(JSC::jsNumber(currentFrame, vv->numberValue));
+ vv->initFrom(JSC::jsNumber(currentFrame, vv->numberValue));
} else { //QScriptValuePrivate::String
- vv->initFromJSCValue(JSC::jsString(currentFrame, vv->stringValue));
+ vv->initFrom(JSC::jsString(currentFrame, vv->stringValue));
}
}
return vv->jscValue;
@@ -3706,7 +3709,7 @@ QScriptValue QScriptEngine::objectById(qint64 id) const
QSet<QScriptValuePrivate*>::const_iterator i = d->attachedScriptValues.constBegin();
while(i != d->attachedScriptValues.constEnd()) {
if ( (*i)->id == id )
- return (*i)->toPublic();
+ return QScriptValuePrivate::get(*i);
i++;
}
return QScriptValue();