aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.lima@openbossa.org>2010-04-14 15:51:22 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 19:09:59 -0300
commit97bff103c6de76a80088083ed2b909527f32c50f (patch)
treed452bb54983376ac9df2db8a08676a43d9ed432e
parent523a07f9b6c10dcd7809523e2491241bc2c1992a (diff)
Removed methods includeFile and setIncludeFile from AbstractMetaAttribute.
These methods were moved to AbstractMetaFunction, because they are created to store the include file of global enums and functions, but for enums, we store the include file in TypeEntry, as functions doesn't have TypeEntries, only global functions need this. Also the new version of includeFile returns a instance of Include class instead of a QString.
-rw-r--r--abstractmetabuilder.cpp5
-rw-r--r--abstractmetalang.h23
2 files changed, 12 insertions, 16 deletions
diff --git a/abstractmetabuilder.cpp b/abstractmetabuilder.cpp
index e33540e34..182f4456d 100644
--- a/abstractmetabuilder.cpp
+++ b/abstractmetabuilder.cpp
@@ -509,7 +509,8 @@ bool AbstractMetaBuilder::build(QIODevice* input)
AbstractMetaFunction* metaFunc = traverseFunction(func);
if (metaFunc) {
- metaFunc->setIncludeFile(func->fileName());
+ QFileInfo info(func->fileName());
+ metaFunc->setIncludeFile(Include(Include::IncludePath, info.fileName()));
m_globalFunctions << metaFunc;
}
}
@@ -903,8 +904,6 @@ AbstractMetaEnum *AbstractMetaBuilder::traverseEnum(EnumModelItem enumItem, Abst
default: break;
}
- metaEnum->setIncludeFile(enumItem->fileName());
-
ReportHandler::debugMedium(QString(" - traversing enum %1").arg(metaEnum->fullName()));
foreach (EnumeratorModelItem value, enumItem->enumerators()) {
diff --git a/abstractmetalang.h b/abstractmetalang.h
index 512553d04..d27e1df9e 100644
--- a/abstractmetalang.h
+++ b/abstractmetalang.h
@@ -274,18 +274,6 @@ public:
return m_originalAttributes & Friendly;
}
- // valid only for global components
- // (e.g.: functions, enums, flags)
- QString includeFile() const
- {
- return m_includeFile;
- }
-
- void setIncludeFile(const QString& file)
- {
- m_includeFile = file;
- }
-
void setDocumentation(const Documentation& doc)
{
m_doc = doc;
@@ -299,7 +287,6 @@ public:
private:
uint m_attributes;
uint m_originalAttributes;
- QString m_includeFile;
Documentation m_doc;
};
@@ -1102,12 +1089,22 @@ public:
return m_propertySpec;
}
+ Include includeFile() const
+ {
+ return m_includeFile;
+ }
+
+ void setIncludeFile(const Include& include)
+ {
+ m_includeFile = include;
+ }
private:
QString m_name;
QString m_originalName;
mutable QString m_cachedMinimalSignature;
mutable QString m_cachedModifiedName;
+ Include m_includeFile;
FunctionType m_functionType;
AbstractMetaType *m_type;
const AbstractMetaClass *m_class;