diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-07-22 16:08:51 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-30 13:18:28 +0200 |
commit | f11e06cc9ac730bd3a06b6ed86e62b1e11064841 (patch) | |
tree | 9e898ec727c4c8239f571f51ba48cca5efa9e4ba /src | |
parent | cc533d80928445c45d6d181f26f0c7dc57c09811 (diff) |
less toUtf8()
Change-Id: I9c4b599511e755b8f93d8bb8a7cd3732ca380de0
Reviewed-on: http://codereview.qt.nokia.com/3771
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/qml/qdeclarativecompiler.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativemetatype.cpp | 10 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativemetatype_p.h | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index bae2ccb66d..2025774c4e 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -1441,7 +1441,7 @@ bool QDeclarativeCompiler::buildSubObject(QDeclarativeParser::Object *obj, const int QDeclarativeCompiler::componentTypeRef() { - QDeclarativeType *t = QDeclarativeMetaType::qmlType("QtQuick/Component",2,0); + QDeclarativeType *t = QDeclarativeMetaType::qmlType(QLatin1String("QtQuick/Component"),2,0); for (int ii = output->types.count() - 1; ii >= 0; --ii) { if (output->types.at(ii).type == t) return ii; diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp index 778dba3de5..97b0391c0b 100644 --- a/src/declarative/qml/qdeclarativemetatype.cpp +++ b/src/declarative/qml/qdeclarativemetatype.cpp @@ -94,7 +94,7 @@ struct QDeclarativeMetaTypeData QList<QDeclarativeType *> types; typedef QHash<int, QDeclarativeType *> Ids; Ids idToType; - typedef QHash<QByteArray, QDeclarativeType *> Names; + typedef QHash<QString, QDeclarativeType *> Names; Names nameToType; typedef QHash<const QMetaObject *, QDeclarativeType *> MetaObjects; MetaObjects metaObjectToType; @@ -841,7 +841,7 @@ int registerInterface(const QDeclarativePrivate::RegisterInterface &interface) data->idToType.insert(type->qListTypeId(), type); // XXX No insertMulti, so no multi-version interfaces? if (!type->qmlTypeName().isEmpty()) - data->nameToType.insert(type->qmlTypeName(), type); + data->nameToType.insert(QString::fromUtf8(type->qmlTypeName()), type); if (data->interfaces.size() <= interface.typeId) data->interfaces.resize(interface.typeId + 16); @@ -875,7 +875,7 @@ int registerType(const QDeclarativePrivate::RegisterType &type) if (dtype->qListTypeId()) data->idToType.insert(dtype->qListTypeId(), dtype); if (!dtype->qmlTypeName().isEmpty()) - data->nameToType.insertMulti(dtype->qmlTypeName(), dtype); + data->nameToType.insertMulti(QString::fromUtf8(dtype->qmlTypeName()), dtype); data->metaObjectToType.insertMulti(dtype->baseMetaObject(), dtype); @@ -1244,7 +1244,7 @@ QDeclarativeMetaType::StringConverter QDeclarativeMetaType::customStringConverte Returns the type (if any) of URI-qualified named \a name in version specified by \a version_major and \a version_minor. */ -QDeclarativeType *QDeclarativeMetaType::qmlType(const QByteArray &name, int version_major, int version_minor) +QDeclarativeType *QDeclarativeMetaType::qmlType(const QString &name, int version_major, int version_minor) { Q_ASSERT(version_major >= 0 && version_minor >= 0); QReadLocker lock(metaTypeDataLock()); @@ -1314,7 +1314,7 @@ QDeclarativeType *QDeclarativeMetaType::qmlType(int userType) /*! Returns the list of registered QML type names. */ -QList<QByteArray> QDeclarativeMetaType::qmlTypeNames() +QList<QString> QDeclarativeMetaType::qmlTypeNames() { QReadLocker lock(metaTypeDataLock()); QDeclarativeMetaTypeData *data = metaTypeData(); diff --git a/src/declarative/qml/qdeclarativemetatype_p.h b/src/declarative/qml/qdeclarativemetatype_p.h index 6dfdf6a0d0..2a6ce20bbb 100644 --- a/src/declarative/qml/qdeclarativemetatype_p.h +++ b/src/declarative/qml/qdeclarativemetatype_p.h @@ -74,10 +74,10 @@ public: static bool canCopy(int type); static bool copy(int type, void *data, const void *copy = 0); - static QList<QByteArray> qmlTypeNames(); + static QList<QString> qmlTypeNames(); static QList<QDeclarativeType*> qmlTypes(); - static QDeclarativeType *qmlType(const QByteArray &, int, int); + static QDeclarativeType *qmlType(const QString &, int, int); static QDeclarativeType *qmlType(const QMetaObject *); static QDeclarativeType *qmlType(const QMetaObject *metaObject, const QString &module, int version_major, int version_minor); static QDeclarativeType *qmlType(int); |