diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2011-09-29 10:29:22 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-29 14:59:15 +0200 |
commit | bcc9a4b3d10899f23b304fecb581aa0d50e1b4e5 (patch) | |
tree | 557b4391429873a0a30e122059a9b1207a1ddb3d /src/declarative/util/qdeclarativelistmodel.cpp | |
parent | 15a52c1a5f9cf166305c264abc01e35bad918d84 (diff) |
Remove more QByteArray<->QString conversions
Prefer to store types as QStrings. It's only when we manipulate
raw (compiled, meta-)data that utf conversion is needed.
Change-Id: Ie138a69c9a409804e1b90b21c1d60dedea35bddb
Reviewed-on: http://codereview.qt-project.org/5781
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/declarative/util/qdeclarativelistmodel.cpp')
-rw-r--r-- | src/declarative/util/qdeclarativelistmodel.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp index 3add850570..cf1dd3b894 100644 --- a/src/declarative/util/qdeclarativelistmodel.cpp +++ b/src/declarative/util/qdeclarativelistmodel.cpp @@ -792,14 +792,14 @@ bool QDeclarativeListModelParser::compileProperty(const QDeclarativeCustomParser error(nodeProp, QDeclarativeListModel::tr("ListElement: cannot contain nested elements")); return false; } - if (nodeProp.name() == "id") { + if (nodeProp.name() == QStringLiteral("id")) { error(nodeProp, QDeclarativeListModel::tr("ListElement: cannot use reserved \"id\" property")); return false; } ListInstruction li; int ref = data.count(); - data.append(nodeProp.name()); + data.append(nodeProp.name().toUtf8()); data.append('\0'); li.type = ListInstruction::Set; li.dataIdx = ref; @@ -895,12 +895,12 @@ QByteArray QDeclarativeListModelParser::compile(const QList<QDeclarativeCustomPa { QList<ListInstruction> instr; QByteArray data; - listElementTypeName = QByteArray(); // unknown + listElementTypeName = QString(); // unknown for(int ii = 0; ii < customProps.count(); ++ii) { const QDeclarativeCustomParserProperty &prop = customProps.at(ii); if(!prop.name().isEmpty()) { // isn't default property - error(prop, QDeclarativeListModel::tr("ListModel: undefined property '%1'").arg(QString::fromUtf8(prop.name()))); + error(prop, QDeclarativeListModel::tr("ListModel: undefined property '%1'").arg(prop.name())); return QByteArray(); } |