diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2012-07-12 15:32:41 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2012-07-12 15:32:41 (GMT) |
commit | 52445a98210e9aa50b3fd4bb36995e117539e490 (patch) | |
tree | 84ec1ff38937e82a2dfe563fc2d140bc337ffd7f /src/ftvhelp.cpp | |
parent | 0ce3aea886f4e95da56d164b3944fd54d3d68f89 (diff) | |
download | Doxygen-52445a98210e9aa50b3fd4bb36995e117539e490.zip Doxygen-52445a98210e9aa50b3fd4bb36995e117539e490.tar.gz Doxygen-52445a98210e9aa50b3fd4bb36995e117539e490.tar.bz2 |
Release-1.8.1.2
Diffstat (limited to 'src/ftvhelp.cpp')
-rw-r--r-- | src/ftvhelp.cpp | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp index c180c4e..76f31ab 100644 --- a/src/ftvhelp.cpp +++ b/src/ftvhelp.cpp @@ -739,7 +739,7 @@ void FTVHelp::addContentsItem(bool isDir, } -static QCString node2URL(FTVNode *n) +static QCString node2URL(FTVNode *n,bool overruleFile=FALSE,bool srcLink=FALSE) { QCString url = n->file; if (!url.isEmpty() && url.at(0)=='!') // relative URL @@ -753,6 +753,18 @@ static QCString node2URL(FTVNode *n) } else // local file (with optional anchor) { + if (overruleFile && n->def && n->def->definitionType()==Definition::TypeFile) + { + FileDef *fd = (FileDef*)n->def; + if (srcLink) + { + url = fd->getSourceFileBase(); + } + else + { + url = fd->getOutputFileBase(); + } + } url+=Doxygen::htmlFileExtension; if (!n->anchor.isEmpty()) url+="#"+n->anchor; } @@ -1085,7 +1097,24 @@ static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t, if (n->addToNavIndex) // add entry to the navigation index { - navIndex.append(new NavIndexEntry(node2URL(n),pathToNode(n,n))); + if (n->def && n->def->definitionType()==Definition::TypeFile) + { + FileDef *fd = (FileDef*)n->def; + bool doc,src; + doc = fileVisibleInIndex(fd,src); + if (doc) + { + navIndex.append(new NavIndexEntry(node2URL(n,TRUE,FALSE),pathToNode(n,n))); + } + if (src) + { + navIndex.append(new NavIndexEntry(node2URL(n,TRUE,TRUE),pathToNode(n,n))); + } + } + else + { + navIndex.append(new NavIndexEntry(node2URL(n),pathToNode(n,n))); + } } if (n->separateIndex) // store items in a separate file for dynamic loading @@ -1191,15 +1220,24 @@ static void generateJSNavTree(const QList<FTVNode> &nodeList) tsidx << "{" << endl; QListIterator<NavIndexEntry> li(navIndex); NavIndexEntry *e; + bool first=TRUE; for (li.toFirst();(e=li.current());) // for each entry { if (elemCount==0) { - t << "\"" << e->url << "\"," << endl; + if (!first) + { + t << "," << endl; + } + else + { + first=FALSE; + } + t << "\"" << e->url << "\""; } tsidx << "\"" << e->url << "\":[" << e->path << "]"; ++li; - if (li.current()) tsidx << ","; // not last entry + if (li.current() && elemCount<maxElemCount-1) tsidx << ","; // not last entry tsidx << endl; elemCount++; @@ -1217,7 +1255,7 @@ static void generateJSNavTree(const QList<FTVNode> &nodeList) } } tsidx << "};" << endl; - t << "];" << endl; + t << endl << "];" << endl; } t << endl << navtree_script; } |