summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-09-21 17:21:50 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-09-21 17:34:36 -0300
commit35bc65d8edc6db5c484e1accafda5787dadfbbf9 (patch)
tree48ba567774921622cc584c1c5adecb77a43233fb
parentc8cc5c1c819f23a3f98fbcc05cff3a15714f31d0 (diff)
downloadshiboken-35bc65d8edc6db5c484e1accafda5787dadfbbf9.tar.gz
shiboken-35bc65d8edc6db5c484e1accafda5787dadfbbf9.tar.xz
shiboken-35bc65d8edc6db5c484e1accafda5787dadfbbf9.zip
Fixes generator to actually use extra includes declared for global enums.
And also for class/namespace enums. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org> Reviewed by Renato Ara├║jo <renato.filho@openbossa.org>
-rw-r--r--generator/cppgenerator.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index 2df2bae9..afa1746e 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -170,6 +170,8 @@ void CppGenerator::generateClass(QTextStream &s, const AbstractMetaClass *metaCl
//Extra includes
s << endl << "// Extra includes" << endl;
QList<Include> includes = metaClass->typeEntry()->extraIncludes();
+ foreach (AbstractMetaEnum* cppEnum, metaClass->enums())
+ includes.append(cppEnum->typeEntry()->extraIncludes());
qSort(includes.begin(), includes.end());
foreach (Include inc, includes)
s << inc.toString() << endl;
@@ -3533,6 +3535,16 @@ void CppGenerator::finishGeneration()
s << include;
s << endl;
+ //Extra includes
+ s << endl << "// Extra includes" << endl;
+ QList<Include> includes;
+ foreach (AbstractMetaEnum* cppEnum, globalEnums())
+ includes.append(cppEnum->typeEntry()->extraIncludes());
+ qSort(includes.begin(), includes.end());
+ foreach (Include inc, includes)
+ s << inc.toString() << endl;
+ s << endl;
+
TypeSystemTypeEntry* moduleEntry = reinterpret_cast<TypeSystemTypeEntry*>(TypeDatabase::instance()->findType(packageName()));
CodeSnipList snips;
if (moduleEntry)