summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-06-29 10:38:17 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 19:10:06 -0300
commitec74d012b6dc5eb49df4259dd64e33e455b8c5cc (patch)
treeab3f7ee7e0695a6a8fc9491c3bc3ce0918c4daec
parent310cd9c13635c5001bc9f63bdcb79ea93cbfccd5 (diff)
Guarantees that namespaces and inner classes will not be repeated.
Lists of global namespaces, inner classes and inner namespaces now have duplicated entries removed.
-rw-r--r--abstractmetabuilder.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/abstractmetabuilder.cpp b/abstractmetabuilder.cpp
index 41a8b953..41d49d00 100644
--- a/abstractmetabuilder.cpp
+++ b/abstractmetabuilder.cpp
@@ -366,8 +366,13 @@ bool AbstractMetaBuilder::build(QIODevice* input)
ReportHandler::flush();
QHash<QString, NamespaceModelItem> namespaceMap = m_dom->namespaceMap();
+ NamespaceList namespaceTypeValues = namespaceMap.values();
+ qSort(namespaceTypeValues);
+ NamespaceList::iterator nsit = std::unique(namespaceTypeValues.begin(), namespaceTypeValues.end());
+ namespaceTypeValues.erase(nsit, namespaceTypeValues.end());
+
ReportHandler::setProgressReference(namespaceMap);
- foreach (NamespaceModelItem item, namespaceMap.values()) {
+ foreach (NamespaceModelItem item, namespaceTypeValues) {
ReportHandler::progress("Generating namespace model...");
AbstractMetaClass *metaClass = traverseNamespace(item);
if (metaClass)
@@ -1130,7 +1135,10 @@ void AbstractMetaBuilder::traverseClassMembers(ScopeModelItem scopeItem)
traverseFunctions(scopeItem, metaClass);
{
- QList<ClassModelItem> innerClasses = scopeItem->classMap().values();
+ ClassList innerClasses = scopeItem->classMap().values();
+ qSort(innerClasses);
+ ClassList::iterator it = std::unique(innerClasses.begin(), innerClasses.end());
+ innerClasses.erase(it, innerClasses.end());
foreach (const ClassModelItem& ci, innerClasses)
traverseClassMembers(model_dynamic_cast<ScopeModelItem>(ci));
}