From: Aaron Kennedy Date: Mon, 4 Jul 2011 04:19:01 +0000 (+1000) Subject: Remove unused fields X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=438d50d63c48bbbfd185bd7e1a0d6e6174c1791e;p=konrad%2Fqtdeclarative.git Remove unused fields Change-Id: I344beb3a01de5b7573a10f4709f334ac64677ad2 Reviewed-on: http://codereview.qt.nokia.com/1131 Reviewed-by: Martin Jones --- diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 32025cc..7571704 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -755,8 +755,6 @@ bool QDeclarativeCompiler::buildObject(QDeclarativeParser::Object *obj, const Bi output->types.at(obj->type); obj->metatype = tr.metaObject(); - if (tr.component) - obj->url = tr.component->url; if (tr.type) obj->typeName = tr.type->qmlTypeName(); obj->className = tr.className; @@ -819,7 +817,6 @@ bool QDeclarativeCompiler::buildObject(QDeclarativeParser::Object *obj, const Bi defaultProperty->isDefault = true; defaultProperty->location = obj->defaultProperty->location; defaultProperty->listValueRange = obj->defaultProperty->listValueRange; - defaultProperty->listCommaPositions = obj->defaultProperty->listCommaPositions; defaultProperty->values = obj->defaultProperty->values; defaultProperty->values += explicitProperty->values; diff --git a/src/declarative/qml/qdeclarativeparser.cpp b/src/declarative/qml/qdeclarativeparser.cpp index cd671bc..0447ea3 100644 --- a/src/declarative/qml/qdeclarativeparser.cpp +++ b/src/declarative/qml/qdeclarativeparser.cpp @@ -66,7 +66,7 @@ using namespace QDeclarativeJS; using namespace QDeclarativeParser; QDeclarativeParser::Object::Object() -: type(-1), majorVersion(-1), minorVersion(-1), idIndex(-1), metatype(0), synthCache(0), defaultProperty(0), parserStatusCast(-1) +: type(-1), idIndex(-1), metatype(0), synthCache(0), defaultProperty(0), parserStatusCast(-1) { } diff --git a/src/declarative/qml/qdeclarativeparser_p.h b/src/declarative/qml/qdeclarativeparser_p.h index 722f9fb..59c41ef 100644 --- a/src/declarative/qml/qdeclarativeparser_p.h +++ b/src/declarative/qml/qdeclarativeparser_p.h @@ -77,13 +77,13 @@ namespace QDeclarativeJS { namespace AST { class Node; } } /* XXX - These types are created (and owned) by the QDeclarativeXmlParser and consumed by the + These types are created (and owned) by the QDeclarativeScriptParser and consumed by the QDeclarativeCompiler. During the compilation phase the compiler will update some of - the fields for both its own use and for the use of the upcoming QDeclarativeDom API. + the fields for its own use. The types are part of the generic sounding "QDeclarativeParser" namespace for legacy reasons (there used to be more in this namespace) and will be cleaned up and - migrated into a more appropriate location shortly. + migrated into a more appropriate location eventually. */ namespace QDeclarativeParser { @@ -124,12 +124,6 @@ namespace QDeclarativeParser // QDeclarativeCompiledData::types array, or -1 if the object is a property // group. int type; - // The url of this object if it is an external type. Used by the DOM - QUrl url; - - // version information if type is defined in library or C++ - int majorVersion; - int minorVersion; // The fully-qualified name of this type QByteArray typeName; @@ -366,7 +360,6 @@ namespace QDeclarativeParser LocationSpan location; LocationRange listValueRange; - QList listCommaPositions; }; } diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp index df1dec5..3f84329 100644 --- a/src/declarative/qml/qdeclarativescriptparser.cpp +++ b/src/declarative/qml/qdeclarativescriptparser.cpp @@ -740,19 +740,6 @@ bool ProcessAST::visit(AST::UiScriptBinding *node) return false; } -static QList collectCommas(AST::UiArrayMemberList *members) -{ - QList commas; - - if (members) { - for (AST::UiArrayMemberList *it = members->next; it; it = it->next) { - commas.append(it->commaToken.offset); - } - } - - return commas; -} - // UiObjectMember: UiQualifiedId T_COLON T_LBRACKET UiArrayMemberList T_RBRACKET ; bool ProcessAST::visit(AST::UiArrayBinding *node) { @@ -781,9 +768,6 @@ bool ProcessAST::visit(AST::UiArrayBinding *node) prop->listValueRange.offset = node->lbracketToken.offset; prop->listValueRange.length = node->rbracketToken.offset + node->rbracketToken.length - node->lbracketToken.offset; - // Store the positions of the comma token too, again for the DOM to be able to retrieve it. - prop->listCommaPositions = collectCommas(node->members); - while (propertyCount--) _stateStack.pop(); diff --git a/src/declarative/qml/qdeclarativetypeloader.cpp b/src/declarative/qml/qdeclarativetypeloader.cpp index a788b4b..47c90bd 100644 --- a/src/declarative/qml/qdeclarativetypeloader.cpp +++ b/src/declarative/qml/qdeclarativetypeloader.cpp @@ -1053,11 +1053,6 @@ void QDeclarativeTypeData::resolveTypes() if (ref.type) { ref.majorVersion = majorVersion; ref.minorVersion = minorVersion; - foreach (QDeclarativeParser::Object *obj, parserRef->refObjects) { - // store namespace for DOM - obj->majorVersion = majorVersion; - obj->minorVersion = minorVersion; - } } else { ref.typeData = typeLoader()->get(url); addDependency(ref.typeData);