FindExportsVisitor: qmlRegisterType

qmlRegisterType can also have 2 template arguments i.e. the
metaRevisionNumber. Consider the case when parsing exported
types.

Change-Id: I553f0e361cc9e9c5a88becd50fd72a33cd35a0d1
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
This commit is contained in:
Aurindam Jana
2012-05-07 15:58:15 +02:00
parent d4c2c3f214
commit 06dc126d7c

View File

@@ -151,10 +151,21 @@ protected:
else else
return false; return false;
// must have a single typeid template argument // check that there is a typeId
if (!templateId->template_argument_list || !templateId->template_argument_list->value if (!templateId->template_argument_list || !templateId->template_argument_list->value)
|| templateId->template_argument_list->next)
return false; return false;
// sometimes there can be a second argument, the metaRevisionNumber
if (templateId->template_argument_list->next) {
if (!templateId->template_argument_list->next->value ||
templateId->template_argument_list->next->next)
return false;
// should just check for a generic ExpressionAST?
NumericLiteralAST *metaRevision =
templateId->template_argument_list->next->value->asNumericLiteral();
if (!metaRevision)
return false;
}
TypeIdAST *typeId = templateId->template_argument_list->value->asTypeId(); TypeIdAST *typeId = templateId->template_argument_list->value->asTypeId();
if (!typeId) if (!typeId)
return false; return false;