aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v4
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-06-26 09:43:45 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-28 14:56:04 +0200
commitf7d727f62c1f1bc0ab756a62ce51b042abf76eb5 (patch)
tree9dd5dc892fb155827e9a4aee5007884ee29e490c /src/qml/qml/v4
parent553b41c407985e5b18f089679c014d884624afbd (diff)
Get rid of QHashedV4String
This was required while we were using V8, but now we can simply pass QV4::String pointers. Change-Id: If6338e4a455d6132fe14e5e603e4fe9e477d1ffb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/v4')
-rw-r--r--src/qml/qml/v4/qv4qobjectwrapper.cpp12
-rw-r--r--src/qml/qml/v4/qv4string_p.h3
2 files changed, 7 insertions, 8 deletions
diff --git a/src/qml/qml/v4/qv4qobjectwrapper.cpp b/src/qml/qml/v4/qv4qobjectwrapper.cpp
index a267c4a894..92fa220aa5 100644
--- a/src/qml/qml/v4/qv4qobjectwrapper.cpp
+++ b/src/qml/qml/v4/qv4qobjectwrapper.cpp
@@ -261,16 +261,14 @@ void QObjectWrapper::initializeBindings(ExecutionEngine *engine)
QQmlPropertyData *QObjectWrapper::findProperty(ExecutionEngine *engine, QQmlContextData *qmlContext, String *name, RevisionMode revisionMode, QQmlPropertyData *local) const
{
- QHashedV4String propertystring(QV4::Value::fromString(name));
-
QQmlData *ddata = QQmlData::get(m_object, false);
if (!ddata)
return 0;
QQmlPropertyData *result = 0;
if (ddata && ddata->propertyCache)
- result = ddata->propertyCache->property(propertystring, m_object, qmlContext);
+ result = ddata->propertyCache->property(name, m_object, qmlContext);
if (!result)
- result = QQmlPropertyCache::property(engine->v8Engine->engine(), m_object, propertystring, qmlContext, *local);
+ result = QQmlPropertyCache::property(engine->v8Engine->engine(), m_object, name, qmlContext, *local);
return result;
}
@@ -297,8 +295,7 @@ Value QObjectWrapper::getQmlProperty(ExecutionContext *ctx, QQmlContextData *qml
if (includeImports && name->startsWithUpper()) {
// Check for attached properties
if (qmlContext && qmlContext->imports) {
- QHashedV4String propertystring(QV4::Value::fromString(name));
- QQmlTypeNameCache::Result r = qmlContext->imports->query(propertystring);
+ QQmlTypeNameCache::Result r = qmlContext->imports->query(name);
if (hasProperty)
*hasProperty = true;
@@ -418,8 +415,7 @@ bool QObjectWrapper::setQmlProperty(ExecutionContext *ctx, QQmlContextData *qmlC
QQmlPropertyData local;
QQmlPropertyData *result = 0;
{
- QHashedV4String property(Value::fromString(name));
- result = QQmlPropertyCache::property(ctx->engine->v8Engine->engine(), object, property, qmlContext, local);
+ result = QQmlPropertyCache::property(ctx->engine->v8Engine->engine(), object, name, qmlContext, local);
}
if (!result)
diff --git a/src/qml/qml/v4/qv4string_p.h b/src/qml/qml/v4/qv4string_p.h
index 205bcec3b0..81108c61e0 100644
--- a/src/qml/qml/v4/qv4string_p.h
+++ b/src/qml/qml/v4/qv4string_p.h
@@ -113,6 +113,9 @@ struct Q_QML_EXPORT String : public Managed {
bool startsWithUpper() const {
return _text.length() && _text.at(0).isUpper();
}
+ int length() const {
+ return _text.length();
+ }
QString _text;
mutable uint stringHash;