[Kde-bindings] KDE/kdebindings/generator
Arno Rehn
kde at arnorehn.de
Sat Nov 7 17:18:32 UTC 2009
SVN commit 1046146 by arnorehn:
Accept expressions as template arguments. Improve the way it works now later.
This fixes a bug with new Qt 4.6 classes reported by David Palacio. Thanks!
CCMAIL: kde-bindings at kde.org
M +8 -1 name_compiler.cpp
--- trunk/KDE/kdebindings/generator/name_compiler.cpp #1046145:1046146
@@ -175,8 +175,15 @@
void NameCompiler::visitTemplateArgument(TemplateArgumentAST *node)
{
- if (!node->type_id)
+ if (!node->type_id) {
+ QString ret;
+ for (int i = node->expression->start_token; i < node->expression->end_token; i++) {
+ ret.append(m_session->token_stream->token(i).symbolString());
+ }
+ // TODO: Better use a new struct here - expressions aren't really types.
+ m_templateArgs[m_name.count()] << Type(ret);
return;
+ }
TypeCompiler tc(m_session, m_visitor);
tc.run(node->type_id->type_specifier, node->type_id->declarator ? node->type_id->declarator : 0);
m_templateArgs[m_name.count()] << tc.type();
More information about the Kde-bindings
mailing list