aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-11-20 19:53:42 +0300
committerAnton Kudryavtsev <antkudr@mail.ru>2016-11-22 14:53:06 +0000
commit13cf5f02ce788f19a73e5d5c3da76e57291761a5 (patch)
tree19c7951b229319b84593130013d89a001da9cf98
parentfbfc433dae873e3cfd1247e020faff4c1303c659 (diff)
QQmlPropertyCache: adapt qQmlPropertyCacheCreate
... to make good use of QL1S Change-Id: I7c3ac1cefb30bee9baa31a3f8ec08f5f57eb5d5b Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
-rw-r--r--src/qml/qml/qqmlpropertycache.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp
index b645d47c39..aac2a42a33 100644
--- a/src/qml/qml/qqmlpropertycache.cpp
+++ b/src/qml/qml/qqmlpropertycache.cpp
@@ -978,7 +978,8 @@ int QQmlPropertyCache::originalClone(QObject *object, int index)
return index;
}
-static QQmlPropertyData qQmlPropertyCacheCreate(const QMetaObject *metaObject, const QStringRef &property)
+template<typename T>
+static QQmlPropertyData qQmlPropertyCacheCreate(const QMetaObject *metaObject, const T& propertyName)
{
Q_ASSERT(metaObject);
@@ -995,8 +996,6 @@ static QQmlPropertyData qQmlPropertyCacheCreate(const QMetaObject *metaObject, c
// These indices don't apply to gadgets, so don't block them.
const bool preventDestruction = metaObject->superClass() || metaObject == &QObject::staticMetaObject;
- const QByteArray propertyName = property.toUtf8();
-
int methodCount = metaObject->methodCount();
for (int ii = methodCount - 1; ii >= 0; --ii) {
if (preventDestruction && (ii == destroyedIdx1 || ii == destroyedIdx2 || ii == deleteLaterIdx))
@@ -1038,19 +1037,19 @@ static QQmlPropertyData qQmlPropertyCacheCreate(const QMetaObject *metaObject, c
return rv;
}
-static inline QQmlPropertyData qQmlPropertyCacheCreate(const QMetaObject *metaObject, const QString &property)
+static inline const char *qQmlPropertyCacheToString(QLatin1String string)
{
- return qQmlPropertyCacheCreate(metaObject, QStringRef(&property));
+ return string.data();
}
-static inline const QStringRef &qQmlPropertyCacheToString(const QStringRef &string)
+static inline QByteArray qQmlPropertyCacheToString(const QStringRef &string)
{
- return string;
+ return string.toUtf8();
}
-static inline QString qQmlPropertyCacheToString(const QV4::String *string)
+static inline QByteArray qQmlPropertyCacheToString(const QV4::String *string)
{
- return string->toQString();
+ return string->toQString().toUtf8();
}
template<typename T>