summaryrefslogtreecommitdiffstats
path: root/generator/headergenerator.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-09-30 10:54:30 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-09-30 11:54:43 -0300
commitdcf1b0969fc4e5fc7c92232140ac1d1d751905a2 (patch)
treefcda77e186a54024c708323ff9e8bc2b92951058 /generator/headergenerator.cpp
parent385c5799cacd75523a1456cc28c05cade2b11ea5 (diff)
downloadshiboken-dcf1b0969fc4e5fc7c92232140ac1d1d751905a2.tar.gz
shiboken-dcf1b0969fc4e5fc7c92232140ac1d1d751905a2.tar.xz
shiboken-dcf1b0969fc4e5fc7c92232140ac1d1d751905a2.zip
Shiboken avoids generating code for private enums.
Reviewed by Luciano Wolf <luciano.wolf@openbossa.org> Reviewed by Renato Ara├║jo <renato.filho@openbossa.org>
Diffstat (limited to 'generator/headergenerator.cpp')
-rw-r--r--generator/headergenerator.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/generator/headergenerator.cpp b/generator/headergenerator.cpp
index 095febb7..f9384d58 100644
--- a/generator/headergenerator.cpp
+++ b/generator/headergenerator.cpp
@@ -281,8 +281,11 @@ void HeaderGenerator::writeTypeIndexDefine(QTextStream& s, const AbstractMetaCla
if (!metaClass->typeEntry()->generateCode())
return;
writeTypeIndexDefineLine(s, metaClass->typeEntry(), idx);
- foreach (const AbstractMetaEnum* metaEnum, metaClass->enums())
+ foreach (const AbstractMetaEnum* metaEnum, metaClass->enums()) {
+ if (metaEnum->isPrivate())
+ continue;
writeTypeIndexDefineLine(s, metaEnum->typeEntry(), idx);
+ }
}
void HeaderGenerator::finishGeneration()
@@ -321,7 +324,7 @@ void HeaderGenerator::finishGeneration()
macrosStream << "// Macros for type check" << endl;
foreach (const AbstractMetaEnum* cppEnum, globalEnums()) {
- if (cppEnum->isAnonymous())
+ if (cppEnum->isAnonymous() || cppEnum->isPrivate())
continue;
includes << cppEnum->typeEntry()->include();
writeTypeConverterDecl(convDecl, cppEnum->typeEntry());
@@ -338,7 +341,7 @@ void HeaderGenerator::finishGeneration()
includes << classType->include();
foreach (const AbstractMetaEnum* cppEnum, metaClass->enums()) {
- if (cppEnum->isAnonymous())
+ if (cppEnum->isAnonymous() || cppEnum->isPrivate())
continue;
EnumTypeEntry* enumType = cppEnum->typeEntry();
includes << enumType->include();