Remove unused fields
authorAaron Kennedy <aaron.kennedy@nokia.com>
Mon, 4 Jul 2011 04:19:01 +0000 (14:19 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 7 Jul 2011 04:40:33 +0000 (06:40 +0200)
Change-Id: I344beb3a01de5b7573a10f4709f334ac64677ad2
Reviewed-on: http://codereview.qt.nokia.com/1131
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/declarative/qml/qdeclarativecompiler.cpp
src/declarative/qml/qdeclarativeparser.cpp
src/declarative/qml/qdeclarativeparser_p.h
src/declarative/qml/qdeclarativescriptparser.cpp
src/declarative/qml/qdeclarativetypeloader.cpp

index 32025cc..7571704 100644 (file)
@@ -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;
index cd671bc..0447ea3 100644 (file)
@@ -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)
 {
 }
 
index 722f9fb..59c41ef 100644 (file)
@@ -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<int> listCommaPositions;
     };
 }
 
index df1dec5..3f84329 100644 (file)
@@ -740,19 +740,6 @@ bool ProcessAST::visit(AST::UiScriptBinding *node)
     return false;
 }
 
-static QList<int> collectCommas(AST::UiArrayMemberList *members)
-{
-    QList<int> 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();
 
index a788b4b..47c90bd 100644 (file)
@@ -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);