aboutsummaryrefslogtreecommitdiffstats
path: root/abstractmetabuilder.cpp
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.lima@openbossa.org>2010-04-13 21:14:55 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 19:09:59 -0300
commit523a07f9b6c10dcd7809523e2491241bc2c1992a (patch)
tree4a20abaf3972adcdee59d9b5ab392c6bde3c96f6 /abstractmetabuilder.cpp
parent133479369928c590d4c351064a356be575debd6c (diff)
Set the include file for enums.
Diffstat (limited to 'abstractmetabuilder.cpp')
-rw-r--r--abstractmetabuilder.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/abstractmetabuilder.cpp b/abstractmetabuilder.cpp
index ac1dcd02..e33540e3 100644
--- a/abstractmetabuilder.cpp
+++ b/abstractmetabuilder.cpp
@@ -928,6 +928,12 @@ AbstractMetaEnum *AbstractMetaBuilder::traverseEnum(EnumModelItem enumItem, Abst
m_enums << metaEnum;
+ if (!metaEnum->typeEntry()->include().isValid()) {
+ QFileInfo info(enumItem->fileName());
+ metaEnum->typeEntry()->setInclude(Include(Include::IncludePath, info.fileName()));
+ }
+ metaEnum->setOriginalAttributes(metaEnum->attributes());
+
return metaEnum;
}
@@ -1433,12 +1439,11 @@ bool AbstractMetaBuilder::setupInheritance(AbstractMetaClass *metaClass)
void AbstractMetaBuilder::traverseEnums(ScopeModelItem scopeItem, AbstractMetaClass *metaClass, const QStringList &enumsDeclarations)
{
EnumList enums = scopeItem->enums();
- foreach (EnumModelItem enum_item, enums) {
- AbstractMetaEnum *meta_enum = traverseEnum(enum_item, metaClass, QSet<QString>::fromList(enumsDeclarations));
- if (meta_enum) {
- meta_enum->setOriginalAttributes(meta_enum->attributes());
- metaClass->addEnum(meta_enum);
- meta_enum->setEnclosingClass(metaClass);
+ foreach (EnumModelItem enumItem, enums) {
+ AbstractMetaEnum *metaEnum = traverseEnum(enumItem, metaClass, QSet<QString>::fromList(enumsDeclarations));
+ if (metaEnum) {
+ metaClass->addEnum(metaEnum);
+ metaEnum->setEnclosingClass(metaClass);
}
}
}