From 30887ace1d06cc76bdd1b5aa3895e21dc39fddab Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Mon, 9 Mar 2020 21:49:47 +0100 Subject: Fix regression when creating directory graphs --- src/dotdirdeps.cpp | 64 +++++++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/src/dotdirdeps.cpp b/src/dotdirdeps.cpp index 59ad75f..66a68df 100644 --- a/src/dotdirdeps.cpp +++ b/src/dotdirdeps.cpp @@ -90,51 +90,55 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations) } // add nodes for other used directories - QDictIterator udi(*dd->usedDirs()); - UsedDir *udir; - //printf("*** For dir %s\n",shortName().data()); - for (udi.toFirst();(udir=udi.current());++udi) - // for each used dir (=directly used or a parent of a directly used dir) { - const DirDef *usedDir=udir->dir(); - const DirDef *dir=dd; - while (dir) + QDictIterator udi(*dd->usedDirs()); + UsedDir *udir; + //printf("*** For dir %s\n",shortName().data()); + for (udi.toFirst();(udir=udi.current());++udi) + // for each used dir (=directly used or a parent of a directly used dir) { - //printf("*** check relation %s->%s same_parent=%d !%s->isParentOf(%s)=%d\n", - // dir->shortName().data(),usedDir->shortName().data(), - // dir->parent()==usedDir->parent(), - // usedDir->shortName().data(), - // shortName().data(), - // !usedDir->isParentOf(this) - // ); - if (dir!=usedDir && dir->parent()==usedDir->parent() && - !usedDir->isParentOf(dd)) - // include if both have the same parent (or no parent) + const DirDef *usedDir=udir->dir(); + const DirDef *dir=dd; + while (dir) { - t << " " << usedDir->getOutputFileBase() << " [shape=box label=\"" - << usedDir->shortName() << "\""; - if (usedDir->isCluster()) + //printf("*** check relation %s->%s same_parent=%d !%s->isParentOf(%s)=%d\n", + // dir->shortName().data(),usedDir->shortName().data(), + // dir->parent()==usedDir->parent(), + // usedDir->shortName().data(), + // shortName().data(), + // !usedDir->isParentOf(this) + // ); + if (dir!=usedDir && dir->parent()==usedDir->parent() && + !usedDir->isParentOf(dd)) + // include if both have the same parent (or no parent) { - if (!Config_getBool(DOT_TRANSPARENT)) + t << " " << usedDir->getOutputFileBase() << " [shape=box label=\"" + << usedDir->shortName() << "\""; + if (usedDir->isCluster()) { - t << " fillcolor=\"white\" style=\"filled\""; + if (!Config_getBool(DOT_TRANSPARENT)) + { + t << " fillcolor=\"white\" style=\"filled\""; + } + t << " color=\"red\""; } - t << " color=\"red\""; + t << " URL=\"" << usedDir->getOutputFileBase() + << Doxygen::htmlFileExtension << "\"];\n"; + dirsInGraph.insert(usedDir->getOutputFileBase(),usedDir); + break; } - t << " URL=\"" << usedDir->getOutputFileBase() - << Doxygen::htmlFileExtension << "\"];\n"; - dirsInGraph.insert(usedDir->getOutputFileBase(),usedDir); - break; + dir=dir->parent(); } - dir=dir->parent(); } } // add relations between all selected directories const DirDef *dir; QDictIterator di(dirsInGraph); - for (di.toFirst();(dir=di.current());++di) // foreach dir in the graph + for (;(dir=di.current());++di) // foreach dir in the graph { + QDictIterator udi(*dir->usedDirs()); + UsedDir *udir; for (udi.toFirst();(udir=udi.current());++udi) // foreach used dir { const DirDef *usedDir=udir->dir(); -- cgit v0.12