summaryrefslogtreecommitdiffstats
path: root/src/searchindex.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2013-05-12 13:04:34 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2013-05-12 13:04:34 (GMT)
commit8dc4ff6dd22b1603f33537ff03994cc63e658768 (patch)
tree97f0e23b93d45b7917d965e6d1bb70da6c61831a /src/searchindex.cpp
parentebf4b3641c9149eaf4468aa8df64e1c7517e5f0c (diff)
downloadDoxygen-8dc4ff6dd22b1603f33537ff03994cc63e658768.zip
Doxygen-8dc4ff6dd22b1603f33537ff03994cc63e658768.tar.gz
Doxygen-8dc4ff6dd22b1603f33537ff03994cc63e658768.tar.bz2
Release-1.8.3.1-20130512
Diffstat (limited to 'src/searchindex.cpp')
-rw-r--r--src/searchindex.cpp33
1 files changed, 7 insertions, 26 deletions
diff --git a/src/searchindex.cpp b/src/searchindex.cpp
index 681fe96..0380b33 100644
--- a/src/searchindex.cpp
+++ b/src/searchindex.cpp
@@ -92,7 +92,9 @@ void SearchIndex::setCurrentDoc(Definition *ctx,const char *anchor,bool isSource
//printf("SearchIndex::setCurrentDoc(%s,%s,%s)\n",name,baseName,anchor);
QCString url=isSourceFile ? ((FileDef*)ctx)->getSourceFileBase() : ctx->getOutputFileBase();
url+=Config_getString("HTML_FILE_EXTENSION");
+ QCString baseUrl = url;
if (anchor) url+=QCString("#")+anchor;
+ if (!isSourceFile) baseUrl=url;
QCString name=ctx->qualifiedName();
if (ctx->definitionType()==Definition::TypeMember)
{
@@ -164,11 +166,11 @@ void SearchIndex::setCurrentDoc(Definition *ctx,const char *anchor,bool isSource
}
}
- int *pIndex = m_url2IdMap.find(url);
+ int *pIndex = m_url2IdMap.find(baseUrl);
if (pIndex==0)
{
++m_urlIndex;
- m_url2IdMap.insert(url,new int(m_urlIndex));
+ m_url2IdMap.insert(baseUrl,new int(m_urlIndex));
m_urls.insert(m_urlIndex,new URL(name,url));
}
else
@@ -422,11 +424,7 @@ struct SearchDocEntry
struct SearchIndexExternal::Private
{
- Private() : docEntries(257) {}
- //QFile f;
- //bool openOk;
- //FTextStream t;
- //bool insideDoc;
+ Private() : docEntries(12251) {}
SDict<SearchDocEntry> docEntries;
SearchDocEntry *current;
};
@@ -436,29 +434,11 @@ SearchIndexExternal::SearchIndexExternal() : SearchIndexIntf(External)
p = new SearchIndexExternal::Private;
p->docEntries.setAutoDelete(TRUE);
p->current=0;
- //p->f.setName(fileName);
- //p->openOk = p->f.open(IO_WriteOnly);
- //if (p->openOk)
- //{
- // p->t.setDevice(&p->f);
- // p->t << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
- // p->t << "<add>" << endl;
- // p->insideDoc=FALSE;
- //}
}
SearchIndexExternal::~SearchIndexExternal()
{
- //if (p->openOk)
- //{
- // if (p->insideDoc)
- // {
- // p->t << " </doc>" << endl;
- // }
- // p->t << "</add>" << endl;
- // p->f.close();
- // p->openOk=FALSE;
- //}
+ //printf("p->docEntries.count()=%d\n",p->docEntries.count());
delete p;
}
@@ -526,6 +506,7 @@ void SearchIndexExternal::setCurrentDoc(Definition *ctx,const char *anchor,bool
QCString key = extId+";"+url;
p->current = p->docEntries.find(key);
+ //printf("setCurrentDoc(url=%s,isSourceFile=%d) current=%p\n",url.data(),isSourceFile,p->current);
if (!p->current)
{
SearchDocEntry *e = new SearchDocEntry;