aboutsummaryrefslogtreecommitdiffstats
path: root/typesystem.cpp
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2010-02-09 14:49:28 -0200
committerHugo Lima <hugo.lima@openbossa.org>2010-02-09 19:00:00 -0200
commite363a1d1d2aa2a05139719adc02756766bc92cc1 (patch)
treeb8c5954af58e9306655d9f448094dcad45b4bbfc /typesystem.cpp
parentf59e7ee17f8be5d29be464e56c0cf901b8e3f023 (diff)
Fix add-function tag when adding a global function.
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'typesystem.cpp')
-rw-r--r--typesystem.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/typesystem.cpp b/typesystem.cpp
index 69bc8455a..098a095e9 100644
--- a/typesystem.cpp
+++ b/typesystem.cpp
@@ -255,11 +255,16 @@ bool Handler::endElement(const QString &, const QString &localName, const QStrin
return true;
switch (m_current->type) {
- case StackElement::Root: {
- TypeDatabase::instance()->setAddedFunctions(m_addedFunctions);
- TypeDatabase::instance()->setFunctionModifications(m_functionMods);
- }
- break;
+ case StackElement::AddFunction:
+ if (m_generate == TypeEntry::GenerateAll
+ && m_current->parent
+ && m_current->parent->type == StackElement::Root) { // Global function
+ TypeDatabase::instance()->addGlobalUserFunctions(m_addedFunctions);
+ TypeDatabase::instance()->addGlobalUserFunctionModifications(m_functionMods);
+ m_addedFunctions.clear();
+ m_functionMods.clear();
+ }
+ break;
case StackElement::ObjectTypeEntry:
case StackElement::ValueTypeEntry:
case StackElement::InterfaceTypeEntry:
@@ -1987,10 +1992,10 @@ FlagsTypeEntry *TypeDatabase::findFlagsType(const QString &name) const
return fte ? fte : (FlagsTypeEntry *) m_flagsEntries.value(name);
}
-AddedFunctionList TypeDatabase::findAddedFunctions(const QString& name) const
+AddedFunctionList TypeDatabase::findGlobalUserFunctions(const QString& name) const
{
AddedFunctionList addedFunctions;
- foreach (AddedFunction func, m_addedFunctions) {
+ foreach (AddedFunction func, m_globalUserFunctions) {
if (func.name() == name)
addedFunctions.append(func);
}