diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-12-14 17:54:57 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-12-16 12:29:54 -0300 |
commit | aeeb950b50a108a2475c0ee630d74420ccb3a0b3 (patch) | |
tree | 60d586e195ab17d75d1c1510ccfdf87129ad6206 /abstractmetabuilder.cpp | |
parent | 00a880f4d61a6a32f3e1dcaa4a692a6e430c123a (diff) |
Adds support for module level 'add-function' tag.
The TypeDatabase now stores global added functions as well as
function modifications.
The AbstractMetaFunction::modifications method was improved to
check for global modifications.
The test suite was updated with the changes.
Diffstat (limited to 'abstractmetabuilder.cpp')
-rw-r--r-- | abstractmetabuilder.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/abstractmetabuilder.cpp b/abstractmetabuilder.cpp index 45e24f282..6ce0232ec 100644 --- a/abstractmetabuilder.cpp +++ b/abstractmetabuilder.cpp @@ -300,6 +300,8 @@ bool AbstractMetaBuilder::build(QIODevice* input) return false; } + TypeDatabase* types = TypeDatabase::instance(); + QByteArray contents = input->readAll(); input->close(); @@ -318,7 +320,6 @@ bool AbstractMetaBuilder::build(QIODevice* input) QHash<QString, ClassModelItem> typeMap = m_dom->classMap(); // fix up QObject's in the type system.. - TypeDatabase *types = TypeDatabase::instance(); fixQObjectForScope(types, model_dynamic_cast<NamespaceModelItem>(m_dom)); // Start the generation... @@ -496,6 +497,14 @@ bool AbstractMetaBuilder::build(QIODevice* input) m_globalFunctions << metaFunc; } } + + // Functions added to the module on the type system. + foreach (AddedFunction addedFunc, types->addedFunctions()) { + AbstractMetaFunction* metaFunc = traverseFunction(addedFunc); + metaFunc->setFunctionType(AbstractMetaFunction::NormalFunction); + m_globalFunctions << metaFunc; + } + std::puts(""); return true; } @@ -2642,7 +2651,6 @@ AbstractMetaClassList AbstractMetaBuilder::classesTopologicalSorted(const Abstra return result; } - AbstractMetaArgumentList AbstractMetaBuilder::reverseList(const AbstractMetaArgumentList& list) { AbstractMetaArgumentList ret; |