aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlscript_p.h
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2012-05-04 13:14:43 +0100
committerQt by Nokia <qt-info@nokia.com>2012-05-04 18:15:03 +0200
commitff55f825234dc7ba7fa1436abebd59f2c0f5e5c9 (patch)
tree63cb8c0b8fe15eea40073f7ce1b478dc669fa3bf /src/qml/qml/qqmlscript_p.h
parent31abe4e2cd65f1fdf9acec29effd85e6b1af73c3 (diff)
Minor optimizations and cleanup
Change-Id: Iecbd5c46af00f649b1f1d78cdf5f2b40a2844897 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlscript_p.h')
-rw-r--r--src/qml/qml/qqmlscript_p.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/qml/qml/qqmlscript_p.h b/src/qml/qml/qqmlscript_p.h
index 1e46e6b655..0a762d457f 100644
--- a/src/qml/qml/qqmlscript_p.h
+++ b/src/qml/qml/qqmlscript_p.h
@@ -124,16 +124,13 @@ public:
};
class Object;
-class TypeReference
+class TypeReference : public QQmlPool::Class
{
public:
- TypeReference(int typeId, const QString &typeName) : id(typeId), name(typeName) {}
-
- int id;
// type as it has been referenced in Qml
QString name;
- // objects in parse tree referencing the type
- QList<QQmlScript::Object*> refObjects;
+ // The first use of this type in the parse tree. Useful for error locations.
+ QQmlScript::Object *firstUse;
};
class Object;
@@ -310,9 +307,10 @@ public:
// QQmlCompiledData::types array, or -1 if the object is a property
// group.
int type;
+ // A back pointer to the QQmlScript::TypeReference for this type, if any.
+ // Set by the parser.
+ TypeReference *typeReference;
- // The fully-qualified name of this type
- QString typeName;
// The id assigned to the object (if any). Set by the QQmlCompiler
QString id;
// The id index assigned to the object (if any). Set by the QQmlCompiler
@@ -503,7 +501,7 @@ public:
// ### private:
- TypeReference *findOrCreateType(const QString &name);
+ int findOrCreateTypeId(const QString &name, Object *);
void setTree(QQmlScript::Object *tree);
void setScriptFile(const QString &filename) {_scriptFile = filename; }