summaryrefslogtreecommitdiffstats
path: root/src/searchindex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/searchindex.cpp')
-rw-r--r--src/searchindex.cpp35
1 files changed, 25 insertions, 10 deletions
diff --git a/src/searchindex.cpp b/src/searchindex.cpp
index 27674c2..da7c391 100644
--- a/src/searchindex.cpp
+++ b/src/searchindex.cpp
@@ -36,6 +36,7 @@
#include "memberdef.h"
#include "filename.h"
#include "membername.h"
+#include "resourcemgr.h"
// file format: (all multi-byte values are stored in big endian format)
// 4 byte header
@@ -583,9 +584,9 @@ void SearchIndexExternal::write(const char *fileName)
#include "doxygen.h"
#include "message.h"
-static const char search_script[]=
-#include "search.js.h"
-;
+//static const char search_script[]=
+//#include "search.js.h"
+//;
#define SEARCH_INDEX_ALL 0
#define SEARCH_INDEX_CLASSES 1
@@ -1265,15 +1266,10 @@ void writeJavascriptSearchIndex()
}
{
- QFile f(searchDirName+"/search.js");
+ QFile f(searchDirName+"/searchdata.js");
if (f.open(IO_WriteOnly))
{
FTextStream t(&f);
- t << "// Search script generated by doxygen" << endl;
- t << "// Copyright (C) 2009 by Dimitri van Heesch." << endl << endl;
- t << "// The code in this file is loosly based on main.js, part of Natural Docs," << endl;
- t << "// which is Copyright (C) 2003-2008 Greg Valure" << endl;
- t << "// Natural Docs is licensed under the GPL." << endl << endl;
t << "var indexSectionsWithContent =" << endl;
t << "{" << endl;
bool first=TRUE;
@@ -1314,8 +1310,25 @@ void writeJavascriptSearchIndex()
}
if (!first) t << "\n";
t << "};" << endl << endl;
- t << search_script;
+ t << "var indexSectionLabels =" << endl;
+ t << "{" << endl;
+ first=TRUE;
+ static SearchIndexCategoryMapping map;
+ j=0;
+ for (i=0;i<NUM_SEARCH_INDICES;i++)
+ {
+ if (g_searchIndexCount[i]>0)
+ {
+ if (!first) t << "," << endl;
+ t << " " << j << ": \"" << convertToXML(map.categoryLabel[i]) << "\"";
+ first=FALSE;
+ j++;
+ }
+ }
+ if (!first) t << "\n";
+ t << "};" << endl << endl;
}
+ ResourceMgr::instance().copyResource("search.js",searchDirName);
}
{
QFile f(searchDirName+"/nomatches.html");
@@ -1343,6 +1356,7 @@ void writeJavascriptSearchIndex()
void writeSearchCategories(FTextStream &t)
{
+#if 0
static SearchIndexCategoryMapping map;
int i,j=0;
for (i=0;i<NUM_SEARCH_INDICES;i++)
@@ -1357,6 +1371,7 @@ void writeSearchCategories(FTextStream &t)
j++;
}
}
+#endif
}
//---------------------------------------------------------------------------------------------