diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2009-10-27 20:10:16 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2009-10-27 20:10:16 (GMT) |
commit | d2aec1bac5dbf774dd640b36aa0a6d7c1288c570 (patch) | |
tree | 7b31e0941321a116a730c80e26726da9202178c3 /src/qhp.cpp | |
parent | a62d9f8f1c2c97d454ff33bc1a4911d1362d9766 (diff) | |
download | Doxygen-d2aec1bac5dbf774dd640b36aa0a6d7c1288c570.zip Doxygen-d2aec1bac5dbf774dd640b36aa0a6d7c1288c570.tar.gz Doxygen-d2aec1bac5dbf774dd640b36aa0a6d7c1288c570.tar.bz2 |
Release-1.6.1-20091027
Diffstat (limited to 'src/qhp.cpp')
-rw-r--r-- | src/qhp.cpp | 98 |
1 files changed, 63 insertions, 35 deletions
diff --git a/src/qhp.cpp b/src/qhp.cpp index 15ecdab..f38cf39 100644 --- a/src/qhp.cpp +++ b/src/qhp.cpp @@ -18,6 +18,9 @@ #include "qhpxmlwriter.h" #include "message.h" #include "config.h" +#include "memberdef.h" +#include "groupdef.h" +#include "filedef.h" #include <qstringlist.h> #include <string.h> @@ -132,7 +135,7 @@ void Qhp::finalize() m_toc.close("toc"); m_doc.insert(m_toc); - // Finish index + // Finish index m_index.close("keywords"); m_doc.insert(m_index); @@ -184,65 +187,90 @@ void Qhp::addContentsItem(bool /*isDir*/, const char * name, } } -void Qhp::addIndexItem(const char * level1, const char * level2, - const char * contRef, const char * /*memRef*/, - const char * anchor, const MemberDef * /*md*/) +void Qhp::addIndexItem(Definition *context,MemberDef *md, + const char *anc,const char *word) { - QCString ref; - if ((m_prevIdName!=level1) || (m_prevIdRef!=contRef)) - { - m_prevIdName = level1; - m_prevIdRef = contRef; + (void)anc; + (void)word; - ref = makeFileName(contRef); + if (md) // member + { + static bool separateMemberPages = Config_getBool("SEPARATE_MEMBER_PAGES"); + if (context==0) // global member + { + if (md->getGroupDef()) + context = md->getGroupDef(); + else if (md->getFileDef()) + context = md->getFileDef(); + } + if (context==0) return; // should not happen + QCString cfname = md->getOutputFileBase(); + QCString cfiname = context->getOutputFileBase(); + QCString level1 = context->name(); + QCString level2 = word ? QCString(word) : md->name(); + QCString contRef = separateMemberPages ? cfname : cfiname; + QCString anchor = anc; + + QCString ref; + + // <keyword name="foo" id="MyApplication::foo" ref="doc.html#foo"/> + ref = makeRef(contRef, anchor); + QCString id = level1+"::"+level2; const char * attributes[] = - { "name", level1, + { + "name", level2, + "id", id, + "ref", ref, + 0 + }; + m_index.openClose("keyword", attributes); + } + else if (context) // container + { + // <keyword name="Foo" id="Foo" ref="doc.html"/> + QCString contRef = context->getOutputFileBase(); + QCString level1 = word ? QCString(word) : context->name(); + QCString ref; + if (anc) + { + ref = makeRef(contRef,anc); + } + else + { + ref = makeFileName(contRef); + } + const char * attributes[] = + { + "name", level1, "id", level1, "ref", ref, 0 }; m_index.openClose("keyword", attributes); } - /* - <keyword name="foo" id="MyApplication::foo" ref="doc.html#foo"/> - */ - ref = makeRef(contRef, anchor); - QCString id(level1); - id += "::"; - id += level2; - const char * attributes[] = - { "name", level2, - "id", id, - "ref", ref, - 0 - }; - m_index.openClose("keyword", attributes); } -void -Qhp::addIndexFile(const char * name) +void Qhp::addIndexFile(const char * name) { addFile(name); } -/*static*/ QCString -Qhp::getQhpFileName() +QCString Qhp::getQhpFileName() { return "index.qhp"; } -/*static*/ QCString -Qhp::getFullProjectName() +QCString Qhp::getFullProjectName() { - QCString const projectName = Config_getString("PROJECT_NAME"); - QCString const versionText = Config_getString("PROJECT_NUMBER"); + QCString projectName = Config_getString("PROJECT_NAME"); + QCString versionText = Config_getString("PROJECT_NUMBER"); + if (projectName.isEmpty()) projectName="Root"; return projectName + (versionText.isEmpty() ? QCString("") : QCString(" ") + versionText); } -void -Qhp::handlePrevSection() +void Qhp::handlePrevSection() { /* <toc> |