[Kde-bindings] branches/KDE/4.4/kdebindings/generator
Arno Rehn
kde at arnorehn.de
Fri Jan 29 13:20:36 UTC 2010
SVN commit 1081974 by arnorehn:
backport from trunk:
Handle return types with prepended 'class' or 'struct'.
(like 'class KMultiTabBarTab *tab(...)'). Fixes a bug reported by
Stefano Crocco.
CCMAIL: kde-bindings at kde.org
M +12 -1 generatorvisitor.cpp
--- branches/KDE/4.4/kdebindings/generator/generatorvisitor.cpp #1081973:1081974
@@ -767,8 +767,19 @@
do {
if (it->element && it->element->initializer) {
hasInitializer = true;
- break;
}
+ if (it->element && it->element->declarator && it->element->declarator->parameter_declaration_clause) {
+ if (popKlass) {
+ // This method return type has 'class' or 'struct' prepended to avoid a forward declaration.
+ // example: 'class KMultiTabBarTab *tab(...)'
+ QString oldClass = klass.top()->toString();
+ klass.top()->setParent(0);
+ classes.insert(klass.top()->toString(), *klass.top());
+ classes.remove(oldClass);
+ klass.pop();
+ popKlass = false;
+ }
+ }
it = it->next;
} while (end != it);
}
More information about the Kde-bindings
mailing list