diff options
author | Hugo Parente Lima <hugo.lima@openbossa.org> | 2010-05-17 18:26:03 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-09 19:10:02 -0300 |
commit | 1124238d66a51f5ebf0074c29475594c4b41a90b (patch) | |
tree | 757736bb94eb9563be4ec80423c90d54da054090 /abstractmetabuilder.cpp | |
parent | c8438a7ce830aa3151f12e71721b9457b33be41d (diff) |
Add better error message when a cyclic type dependency is found.
Diffstat (limited to 'abstractmetabuilder.cpp')
-rw-r--r-- | abstractmetabuilder.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/abstractmetabuilder.cpp b/abstractmetabuilder.cpp index 16047a64c..54c4a7051 100644 --- a/abstractmetabuilder.cpp +++ b/abstractmetabuilder.cpp @@ -47,6 +47,7 @@ #include <cstdio> #include <algorithm> #include "graph.h" +#include <QTemporaryFile> static QString stripTemplateArgs(const QString &name) { @@ -2667,7 +2668,15 @@ AbstractMetaClassList AbstractMetaBuilder::classesTopologicalSorted(const Abstra AbstractMetaClassList result; unmappedResult = graph.topologicalSort(); if (unmappedResult.isEmpty()) { - ReportHandler::warning("Cyclic dependency found!"); + QTemporaryFile tempFile; + tempFile.setAutoRemove(false); + tempFile.open(); + QHash<int, QString> hash; + QHash<QString, int>::iterator it = map.begin(); + for (; it != map.end(); ++it) + hash[it.value()] = it.key(); + graph.dumpDot(hash, tempFile.fileName()); + ReportHandler::warning("Cyclic dependency found! Graph can be found at "+tempFile.fileName()); } else { foreach (int i, unmappedResult) { Q_ASSERT(reverseMap.contains(i)); |