summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-06-24 16:31:16 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 19:10:06 -0300
commit2d266c0947c72635c2a1c3550a44497f16473d91 (patch)
tree1f0e2df0f1e943ea3a44545ca7b0c5ca80f8f840
parent2236d656664f6a07e52ffde474b5c7d6e5b78467 (diff)
Fixed namespace resolution name.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>, Marcelo Lira <marcelo.lira@openbossa.org>
-rw-r--r--abstractmetabuilder.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/abstractmetabuilder.cpp b/abstractmetabuilder.cpp
index bf9fca0d..2ceb7b24 100644
--- a/abstractmetabuilder.cpp
+++ b/abstractmetabuilder.cpp
@@ -1816,8 +1816,21 @@ AbstractMetaType* AbstractMetaBuilder::translateType(const TypeInfo& _typei, boo
if (qualifiedName == "QFlags")
qualifiedName = typeInfo.toString();
+ const TypeEntry *type = 0;
// 5. Try to find the type
- const TypeEntry *type = TypeDatabase::instance()->findType(qualifiedName);
+
+ // 5.1 - Try first using the current scope
+ if (m_currentClass) {
+ QStringList context = m_currentClass->qualifiedCppName().split("::");
+ while(!type && (context.size() > 0) ) {
+ type = TypeDatabase::instance()->findType(context.join("::") + "::" + qualifiedName);
+ context.removeLast();
+ }
+ }
+
+ // 5.2 - Try without scope
+ if (!type)
+ type = TypeDatabase::instance()->findType(qualifiedName);
// 6. No? Try looking it up as a flags type
if (!type)