summaryrefslogtreecommitdiffstats
path: root/src/dot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dot.cpp')
-rw-r--r--src/dot.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/dot.cpp b/src/dot.cpp
index 95c52fe..ffe1028 100644
--- a/src/dot.cpp
+++ b/src/dot.cpp
@@ -69,9 +69,11 @@ static const char svgZoomHeader[] =
"]]></style>\n"
"<script type=\"text/javascript\"><![CDATA[\n"
"var edges = document.getElementsByTagName('g');\n"
-"for (var i=0;i<edges.length;i++) {\n"
-" if (edges[i].id.substr(0,4)=='edge') {\n"
-" edges[i].setAttribute('class','edge');\n"
+"if (edges && edges.length) {\n"
+" for (var i=0;i<edges.length;i++) {\n"
+" if (edges[i].id.substr(0,4)=='edge') {\n"
+" edges[i].setAttribute('class','edge');\n"
+" }\n"
" }\n"
"}\n"
"]]></script>\n"
@@ -377,7 +379,7 @@ static bool convertMapFile(FTextStream &t,const char *mapName,
QFile f(mapName);
if (!f.open(IO_ReadOnly))
{
- err("error: problems opening map file %s for inclusion in the docs!\n"
+ err("problems opening map file %s for inclusion in the docs!\n"
"If you installed Graphviz/dot after a previous failing run, \n"
"try deleting the output directory and rerun doxygen.\n",mapName);
return FALSE;
@@ -671,7 +673,7 @@ static void checkDotResult(const QCString &imgName)
{
if (!(data[1]=='P' && data[2]=='N' && data[3]=='G'))
{
- err("error: Image `%s' produced by dot is not a valid PNG!\n"
+ err("Image `%s' produced by dot is not a valid PNG!\n"
"You should either select a different format "
"(DOT_IMAGE_FORMAT in the config file) or install a more "
"recent version of graphviz (1.7+)\n",imgName.data()
@@ -680,13 +682,13 @@ static void checkDotResult(const QCString &imgName)
}
else
{
- err("error: Could not read image `%s' generated by dot!\n",imgName.data());
+ err("Could not read image `%s' generated by dot!\n",imgName.data());
}
fclose(f);
}
else
{
- err("error: Could not open image `%s' generated by dot!\n",imgName.data());
+ err("Could not open image `%s' generated by dot!\n",imgName.data());
}
}
}
@@ -852,7 +854,7 @@ bool DotRunner::run()
}
if (!postCmd.isEmpty() && portable_system(postCmd,postArgs)!=0)
{
- err("error: Problems running '%s' as a post-processing step for dot output\n",m_postCmd.data());
+ err("Problems running '%s' as a post-processing step for dot output\n",m_postCmd.data());
return FALSE;
}
if (checkResult) checkDotResult(imageName);
@@ -969,13 +971,13 @@ bool DotFilePatcher::run()
QFile fo(m_patchFile);
if (!fi.open(IO_ReadOnly))
{
- err("error: problem opening file %s for patching!\n",tmpName.data());
+ err("problem opening file %s for patching!\n",tmpName.data());
QDir::current().rename(tmpName,m_patchFile);
return FALSE;
}
if (!fo.open(IO_WriteOnly))
{
- err("error: problem opening file %s for patching!\n",m_patchFile.data());
+ err("problem opening file %s for patching!\n",m_patchFile.data());
QDir::current().rename(tmpName,m_patchFile);
return FALSE;
}
@@ -1120,12 +1122,12 @@ bool DotFilePatcher::run()
QFile fo(orgName);
if (!fi.open(IO_ReadOnly))
{
- err("error: problem opening file %s for reading!\n",tmpName.data());
+ err("problem opening file %s for reading!\n",tmpName.data());
return FALSE;
}
if (!fo.open(IO_WriteOnly))
{
- err("error: problem opening file %s for writing!\n",orgName.data());
+ err("problem opening file %s for writing!\n",orgName.data());
return FALSE;
}
FTextStream t(&fo);
@@ -2270,7 +2272,7 @@ void DotGfxHierarchyTable::writeGraph(FTextStream &out,
// store the original directory
if (!d.exists())
{
- err("error: Output dir %s does not exist!\n",path); exit(1);
+ err("Output dir %s does not exist!\n",path); exit(1);
}
// put each connected subgraph of the hierarchy in a row of the HTML output
@@ -2699,7 +2701,7 @@ bool DotClassGraph::determineVisibleNodes(DotNode *rootNode,
{
DotNode *n = childQueue.take(0);
int distance = n->distance();
- if (!n->isVisible() && distance<maxDistance) // not yet processed
+ if (!n->isVisible() && distance<=maxDistance) // not yet processed
{
if (distance>0)
{
@@ -2728,7 +2730,7 @@ bool DotClassGraph::determineVisibleNodes(DotNode *rootNode,
if (includeParents && parentQueue.count()>0)
{
DotNode *n = parentQueue.take(0);
- if ((!n->isVisible() || firstNode) && n->distance()<maxDistance) // not yet processed
+ if ((!n->isVisible() || firstNode) && n->distance()<=maxDistance) // not yet processed
{
firstNode=FALSE;
int distance = n->distance();
@@ -3084,7 +3086,7 @@ QCString DotClassGraph::writeGraph(FTextStream &out,
// store the original directory
if (!d.exists())
{
- err("error: Output dir %s does not exist!\n",path); exit(1);
+ err("Output dir %s does not exist!\n",path); exit(1);
}
static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
@@ -3325,7 +3327,7 @@ void DotInclDepGraph::determineVisibleNodes(QList<DotNode> &queue, int &maxNodes
{
static int maxDistance = Config_getInt("MAX_DOT_GRAPH_DEPTH");
DotNode *n = queue.take(0);
- if (!n->isVisible() && n->distance()<maxDistance) // not yet processed
+ if (!n->isVisible() && n->distance()<=maxDistance) // not yet processed
{
n->markAsVisible();
maxNodes--;
@@ -3371,7 +3373,6 @@ void DotInclDepGraph::determineTruncatedNodes(QList<DotNode> &queue)
DotInclDepGraph::DotInclDepGraph(FileDef *fd,bool inverse)
{
- m_maxDistance = 0;
m_inverse = inverse;
ASSERT(fd!=0);
m_diskName = fd->getFileBase().copy();
@@ -3428,7 +3429,7 @@ QCString DotInclDepGraph::writeGraph(FTextStream &out,
// store the original directory
if (!d.exists())
{
- err("error: Output dir %s does not exist!\n",path); exit(1);
+ err("Output dir %s does not exist!\n",path); exit(1);
}
static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
@@ -3572,14 +3573,14 @@ int DotCallGraph::m_curNodeNumber = 0;
void DotCallGraph::buildGraph(DotNode *n,MemberDef *md,int distance)
{
- LockingPtr<MemberSDict> refs = m_inverse ? md->getReferencedByMembers() : md->getReferencesMembers();
- if (!refs.isNull())
+ MemberSDict *refs = m_inverse ? md->getReferencedByMembers() : md->getReferencesMembers();
+ if (refs)
{
MemberSDict::Iterator mri(*refs);
MemberDef *rmd;
for (;(rmd=mri.current());++mri)
{
- if (rmd->isFunction() || rmd->isSlot() || rmd->isSignal())
+ if (rmd->showInCallGraph())
{
QCString uniqueId;
uniqueId=rmd->getReference()+"$"+
@@ -3629,7 +3630,7 @@ void DotCallGraph::determineVisibleNodes(QList<DotNode> &queue, int &maxNodes)
{
static int maxDistance = Config_getInt("MAX_DOT_GRAPH_DEPTH");
DotNode *n = queue.take(0);
- if (!n->isVisible() && n->distance()<maxDistance) // not yet processed
+ if (!n->isVisible() && n->distance()<=maxDistance) // not yet processed
{
n->markAsVisible();
maxNodes--;
@@ -3676,7 +3677,6 @@ void DotCallGraph::determineTruncatedNodes(QList<DotNode> &queue)
DotCallGraph::DotCallGraph(MemberDef *md,bool inverse)
{
- m_maxDistance = 0;
m_inverse = inverse;
m_diskName = md->getOutputFileBase()+"_"+md->anchor();
m_scope = md->getOuterScope();
@@ -3732,7 +3732,7 @@ QCString DotCallGraph::writeGraph(FTextStream &out, GraphOutputFormat format,
// store the original directory
if (!d.exists())
{
- err("error: Output dir %s does not exist!\n",path); exit(1);
+ err("Output dir %s does not exist!\n",path); exit(1);
}
static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
@@ -3870,7 +3870,7 @@ QCString DotDirDeps::writeGraph(FTextStream &out,
// store the original directory
if (!d.exists())
{
- err("error: Output dir %s does not exist!\n",path); exit(1);
+ err("Output dir %s does not exist!\n",path); exit(1);
}
static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
@@ -3995,7 +3995,7 @@ void generateGraphLegend(const char *path)
// store the original directory
if (!d.exists())
{
- err("error: Output dir %s does not exist!\n",path); exit(1);
+ err("Output dir %s does not exist!\n",path); exit(1);
}
QGString theGraph;
@@ -4070,7 +4070,7 @@ void writeDotGraphFromFile(const char *inFile,const char *outDir,
QDir d(outDir);
if (!d.exists())
{
- err("error: Output dir %s does not exist!\n",outDir); exit(1);
+ err("Output dir %s does not exist!\n",outDir); exit(1);
}
QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT");
@@ -4124,7 +4124,7 @@ void writeDotImageMapFromFile(FTextStream &t,
QDir d(outDir);
if (!d.exists())
{
- err("error: Output dir %s does not exist!\n",outDir.data()); exit(1);
+ err("Output dir %s does not exist!\n",outDir.data()); exit(1);
}
QCString mapName = baseName+".map";
@@ -4192,8 +4192,8 @@ void DotGroupCollaboration::buildGraph(GroupDef* gd)
// hierarchy.
// Write parents
- LockingPtr<GroupList> groups = gd->partOfGroups();
- if ( groups!=0 )
+ GroupList *groups = gd->partOfGroups();
+ if ( groups )
{
GroupListIterator gli(*groups);
GroupDef *d;
@@ -4386,7 +4386,7 @@ QCString DotGroupCollaboration::writeGraph( FTextStream &t, GraphOutputFormat fo
// store the original directory
if (!d.exists())
{
- err("error: Output dir %s does not exist!\n",path); exit(1);
+ err("Output dir %s does not exist!\n",path); exit(1);
}
static bool usePDFLatex = Config_getBool("USE_PDFLATEX");