diff options
author | Charles Yin <charles.yin@nokia.com> | 2011-05-25 13:45:18 +1000 |
---|---|---|
committer | Charles Yin <charles.yin@nokia.com> | 2011-05-25 13:53:31 +1000 |
commit | c741910ef6857e355c0715b872902df87fd4443f (patch) | |
tree | f0c435e16bcded31ad7d62ae5024d3b4fda85eff /src/declarative | |
parent | 62fcdaf08a015fd493de3ee446934904e765f40d (diff) |
Revert "cache the arguments in property cache data"
This reverts commit 30327650798ba63281c7b9344c9d824d00dce82a.
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qdeclarativepropertycache.cpp | 31 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativepropertycache_p.h | 5 |
2 files changed, 3 insertions, 33 deletions
diff --git a/src/declarative/qml/qdeclarativepropertycache.cpp b/src/declarative/qml/qdeclarativepropertycache.cpp index f39cdd9e6c..9cbb4fa8cc 100644 --- a/src/declarative/qml/qdeclarativepropertycache.cpp +++ b/src/declarative/qml/qdeclarativepropertycache.cpp @@ -93,26 +93,6 @@ void QDeclarativePropertyCache::Data::load(const QMetaProperty &p, QDeclarativeE revision = p.revision(); } -int QDeclarativePropertyCache::Data::enumType(const QMetaObject *meta, const QString &strname) -{ - QByteArray str = strname.toUtf8(); - QByteArray scope; - QByteArray name; - int scopeIdx = str.lastIndexOf("::"); - if (scopeIdx != -1) { - scope = str.left(scopeIdx); - name = str.mid(scopeIdx + 2); - } else { - name = str; - } - for (int i = meta->enumeratorCount() - 1; i >= 0; --i) { - QMetaEnum m = meta->enumerator(i); - if ((m.name() == name) && (scope.isEmpty() || (m.scope() == scope))) - return QVariant::Int; - } - return QVariant::Invalid; -} - void QDeclarativePropertyCache::Data::load(const QMetaMethod &m) { coreIndex = m.methodIndex(); @@ -127,17 +107,8 @@ void QDeclarativePropertyCache::Data::load(const QMetaMethod &m) propType = QMetaType::type(returnType); QList<QByteArray> params = m.parameterTypes(); - if (!params.isEmpty()) { + if (!params.isEmpty()) flags |= Data::HasArguments; - paramTypes.resize(params.size()); - for (int i = 0; i < params.size(); ++i) { - paramTypes[i] = QMetaType::type(params.at(i)); - if (paramTypes[i] == QVariant::Invalid) - paramTypes[i] = enumType(m.enclosingMetaObject(), QString::fromLatin1(params.at(i))); - if (paramTypes[i] == QVariant::Invalid) - paramTypes[i] = -1; //Unknown method parameter type - } - } revision = m.revision(); } diff --git a/src/declarative/qml/qdeclarativepropertycache_p.h b/src/declarative/qml/qdeclarativepropertycache_p.h index 86ccfe0187..65a8725b8f 100644 --- a/src/declarative/qml/qdeclarativepropertycache_p.h +++ b/src/declarative/qml/qdeclarativepropertycache_p.h @@ -64,6 +64,7 @@ QT_BEGIN_NAMESPACE class QDeclarativeEngine; class QMetaProperty; + class Q_AUTOTEST_EXPORT QDeclarativePropertyCache : public QDeclarativeRefCount, public QDeclarativeCleanup { public: @@ -73,7 +74,6 @@ public: struct Data { inline Data(); - inline bool operator==(const Data &); enum Flag { @@ -115,9 +115,8 @@ public: int overrideIndex : 31; int revision; int metaObjectOffset; - QVector<int> paramTypes; + static Flags flagsForProperty(const QMetaProperty &, QDeclarativeEngine *engine = 0); - int enumType(const QMetaObject *meta, const QString &strname); void load(const QMetaProperty &, QDeclarativeEngine *engine = 0); void load(const QMetaMethod &); QString name(QObject *); |