summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuciano Wolf <luciano.wolf@openbossa.org>2010-07-28 14:22:12 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 19:10:07 -0300
commit694326a3ba5547556072afc3c0f63c29e311bc9b (patch)
tree45fc2dcdb5025773b670cc0f603cc6fe3f1656e1
parent28da24d29cfc5137a4cf1940c9fa45d519334e17 (diff)
Fix wrong behaviour of topological sort.
When dealing with repeated and unordered classes it can generate an invalid result array. Reviewer: Renato Ara├║jo <renato.filho@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
-rw-r--r--abstractmetabuilder.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/abstractmetabuilder.cpp b/abstractmetabuilder.cpp
index b02a60fb..6bfee26c 100644
--- a/abstractmetabuilder.cpp
+++ b/abstractmetabuilder.cpp
@@ -2668,15 +2668,17 @@ AbstractMetaClassList AbstractMetaBuilder::classesTopologicalSorted(const Abstra
const AbstractMetaClassList& classList = cppClass ? cppClass->innerClasses() : m_metaClasses;
- Graph graph(classList.count());
-
int i = 0;
foreach (AbstractMetaClass* clazz, classList) {
+ if (map.contains(clazz->qualifiedCppName()))
+ continue;
map[clazz->qualifiedCppName()] = i;
reverseMap[i] = clazz;
i++;
}
+ Graph graph(map.count());
+
// TODO choose a better name to these regexs
QRegExp regex1("\\(.*\\)");
QRegExp regex2("::.*");