diff options
author | Aurindam Jana <aurindam.jana@nokia.com> | 2012-05-07 15:58:15 +0200 |
---|---|---|
committer | Aurindam Jana <aurindam.jana@nokia.com> | 2012-05-07 17:07:37 +0200 |
commit | 06dc126d7c03999af10858691f73500116cd344f (patch) | |
tree | 469af916f5b6a820fe52f69cdc2c541408fb808d /src/plugins/qmljstools | |
parent | d4c2c3f214ebfbdd39674a9f281394315aab59f8 (diff) | |
download | qt-creator-06dc126d7c03999af10858691f73500116cd344f.tar.gz |
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>
Diffstat (limited to 'src/plugins/qmljstools')
-rw-r--r-- | src/plugins/qmljstools/qmljsfindexportedcpptypes.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/plugins/qmljstools/qmljsfindexportedcpptypes.cpp b/src/plugins/qmljstools/qmljsfindexportedcpptypes.cpp index 07d459334f..ef6d014082 100644 --- a/src/plugins/qmljstools/qmljsfindexportedcpptypes.cpp +++ b/src/plugins/qmljstools/qmljsfindexportedcpptypes.cpp @@ -151,10 +151,21 @@ protected: else return false; - // must have a single typeid template argument - if (!templateId->template_argument_list || !templateId->template_argument_list->value - || templateId->template_argument_list->next) + // check that there is a typeId + if (!templateId->template_argument_list || !templateId->template_argument_list->value) 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(); if (!typeId) return false; |