From c3cbbf362c769b065fd0586b0510d043cbae92a4 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Fri, 22 Jul 2016 15:44:53 +0300 Subject: Qml: use const (and const APIs) more For CoW types, prefer const methods to avoid needless detach()ing. Change-Id: I13e4d5b091877319984c1ddaed4da8dc59a7c0a3 Reviewed-by: Shawn Rutledge --- src/qml/qml/qqmlpropertycache.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/qml/qml/qqmlpropertycache.cpp') diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp index 31218f5e4c..71b3fd8309 100644 --- a/src/qml/qml/qqmlpropertycache.cpp +++ b/src/qml/qml/qqmlpropertycache.cpp @@ -195,7 +195,7 @@ void QQmlPropertyData::load(const QMetaMethod &m) if (m.parameterCount()) { flags.hasArguments = true; - if ((m.parameterCount() == 1) && (m.parameterTypes().first() == "QQmlV4Function*")) { + if ((m.parameterCount() == 1) && (m.parameterTypes().constFirst() == "QQmlV4Function*")) { flags.isV4Function = true; } } @@ -231,7 +231,7 @@ void QQmlPropertyData::lazyLoad(const QMetaMethod &m) const int paramCount = m.parameterCount(); if (paramCount) { flags.hasArguments = true; - if ((paramCount == 1) && (m.parameterTypes().first() == "QQmlV4Function*")) { + if ((paramCount == 1) && (m.parameterTypes().constFirst() == "QQmlV4Function*")) { flags.isV4Function = true; } } @@ -390,7 +390,7 @@ void QQmlPropertyCache::appendSignal(const QString &name, QQmlPropertyData::Flag signalHandlerIndexCache.append(handler); QString handlerName = QLatin1String("on") + name; - handlerName[2] = handlerName[2].toUpper(); + handlerName[2] = handlerName.at(2).toUpper(); setNamedProperty(name, methodIndex + methodOffset(), methodIndexCache.data() + methodIndex, (old != 0)); setNamedProperty(handlerName, signalHandlerIndex + signalOffset(), signalHandlerIndexCache.data() + signalHandlerIndex, (old != 0)); -- cgit v1.2.3