qdoc: Disable generation of .pageindex file.

The .pageindex file was generated for the search engine on the
doc.qt.nokia.com website, since this website is not used anymore there
is no use for the .pageindex file.

Task-number: QTBUG-24911
Change-Id: Ie74f569ce881ab383d83ac9c5a8bc223da91564a
Reviewed-by: Martin Smith <martin.smith@nokia.com>
This commit is contained in:
Casper van Donderen 2012-03-21 13:28:25 +01:00 committed by Qt by Nokia
parent 9dc86ac0f2
commit 3ba8d3b4b0
2 changed files with 0 additions and 227 deletions

View File

@ -279,7 +279,6 @@ void HtmlGenerator::generateTree(const Tree *tree)
QString fileBase = project.toLower().simplified().replace(" ", "-");
generateIndex(fileBase, projectUrl, projectDescription);
generatePageIndex(outputDir() + QLatin1Char('/') + fileBase + ".pageindex");
helpProjectWriter->generate(myTree);
generateManifestFiles();
@ -4289,225 +4288,6 @@ void HtmlGenerator::generateInstantiatedBy(const ClassNode* cn, CodeMarker* mark
}
}
/*!
Generate the <page> element for the given \a node using the \a writer.
Return true if a <page> element was written; otherwise return false.
*/
bool HtmlGenerator::generatePageElement(QXmlStreamWriter& writer,
const Node* node,
CodeMarker* marker) const
{
if (node->pageType() == Node::NoPageType)
return false;
if (node->name().isEmpty())
return true;
if (node->access() == Node::Private)
return false;
QString guid = QUuid::createUuid().toString();
QString title;
QString rawTitle;
QString fullTitle;
QStringList pageWords;
QXmlStreamAttributes attributes;
QString url = node->outputSubdirectory();
if (!url.isEmpty())
url.append(QLatin1Char('/'));
url.append(Generator::fileName(node));
writer.writeStartElement("page");
if (node->isInnerNode()) {
const InnerNode* inner = static_cast<const InnerNode*>(node);
if (!inner->pageKeywords().isEmpty())
pageWords << inner->pageKeywords();
switch (node->type()) {
case Node::Fake:
{
const FakeNode* fake = static_cast<const FakeNode*>(node);
title = fake->fullTitle();
pageWords << title;
break;
}
case Node::Class:
{
title = node->name() + " Class";
pageWords << node->name() << "class" << "reference";
break;
}
case Node::Namespace:
{
rawTitle = marker->plainName(inner);
fullTitle = marker->plainFullName(inner);
title = rawTitle + " Namespace";
pageWords << rawTitle << "namespace" << "reference";
break;
}
default:
title = node->name();
pageWords << title;
break;
}
}
else {
switch (node->type()) {
case Node::Enum:
{
title = node->name() + " Enum";
pageWords << node->name() << "enum" << "type";
url += QLatin1Char('#') + node->name() + "-enum";
break;
}
case Node::Function:
{
title = node->name() + " Function";
pageWords << node->name() << "function";
url += QLatin1Char('#') + node->name();
break;
}
case Node::Property:
{
title = node->name() + " Property";
pageWords << node->name() << "property";
url += QLatin1Char('#') + node->name() + "-prop";
break;
}
case Node::Typedef:
{
title = node->name() + " Type";
pageWords << node->name() << "typedef" << "type";
url += QLatin1Char('#') + node->name();
break;
}
default:
title = node->name();
pageWords << title;
break;
}
Node* parent = node->parent();
if (parent && ((parent->type() == Node::Class) ||
(parent->type() == Node::Namespace))) {
pageWords << parent->name();
}
}
writer.writeAttribute("id",guid);
writer.writeStartElement("pageWords");
writer.writeCharacters(pageWords.join(" "));
writer.writeEndElement();
writer.writeStartElement("pageTitle");
writer.writeCharacters(title);
writer.writeEndElement();
writer.writeStartElement("pageUrl");
writer.writeCharacters(url);
writer.writeEndElement();
writer.writeStartElement("pageType");
QString ptype = "Article";
switch (node->pageType()) {
case Node::ApiPage:
ptype = "APIPage";
break;
case Node::ArticlePage:
ptype = "Article";
break;
case Node::ExamplePage:
ptype = "Example";
break;
case Node::HowToPage:
ptype = "HowTo";
break;
case Node::OverviewPage:
ptype = "Overview";
break;
case Node::TutorialPage:
ptype = "Tutorial";
break;
case Node::FAQPage:
ptype = "FAQ";
break;
default:
break;
}
writer.writeCharacters(ptype);
writer.writeEndElement();
writer.writeEndElement();
if (node->type() == Node::Fake && node->doc().hasTableOfContents()) {
QList<Atom*> toc = node->doc().tableOfContents();
if (!toc.isEmpty()) {
for (int i = 0; i < toc.size(); ++i) {
Text headingText = Text::sectionHeading(toc.at(i));
QString s = headingText.toString();
writer.writeStartElement("page");
guid = QUuid::createUuid().toString();
QString internalUrl = url + QLatin1Char('#') + Doc::canonicalTitle(s);
writer.writeAttribute("id",guid);
writer.writeStartElement("pageWords");
writer.writeCharacters(pageWords.join(" "));
writer.writeCharacters(" ");
writer.writeCharacters(s);
writer.writeEndElement();
writer.writeStartElement("pageTitle");
writer.writeCharacters(s);
writer.writeEndElement();
writer.writeStartElement("pageUrl");
writer.writeCharacters(internalUrl);
writer.writeEndElement();
writer.writeStartElement("pageType");
writer.writeCharacters("Article");
writer.writeEndElement();
writer.writeEndElement();
}
}
}
return true;
}
/*!
Traverse the tree recursively and generate the <keyword>
elements.
*/
void HtmlGenerator::generatePageElements(QXmlStreamWriter& writer, const Node* node, CodeMarker* marker) const
{
if (generatePageElement(writer, node, marker)) {
if (node->isInnerNode()) {
const InnerNode *inner = static_cast<const InnerNode *>(node);
// Recurse to write an element for this child node and all its children.
foreach (const Node *child, inner->childNodes())
generatePageElements(writer, child, marker);
}
}
}
/*!
Outputs the file containing the index used for searching the html docs.
*/
void HtmlGenerator::generatePageIndex(const QString& fileName) const
{
QFile file(fileName);
if (!file.open(QFile::WriteOnly | QFile::Text))
return ;
CodeMarker *marker = CodeMarker::markerForFileName(fileName);
QXmlStreamWriter writer(&file);
writer.setAutoFormatting(true);
writer.writeStartDocument();
writer.writeStartElement("qtPageIndex");
generatePageElements(writer, myTree->root(), marker);
writer.writeEndElement(); // qtPageIndex
writer.writeEndDocument();
file.close();
}
void HtmlGenerator::generateExtractionMark(const Node *node, ExtractionMarkType markType)
{
if (markType != EndMark) {

View File

@ -239,13 +239,6 @@ private:
const Node *relative,
CodeMarker *marker);
void endLink();
bool generatePageElement(QXmlStreamWriter& writer,
const Node* node,
CodeMarker* marker) const;
void generatePageElements(QXmlStreamWriter& writer,
const Node* node,
CodeMarker* marker) const;
void generatePageIndex(const QString& fileName) const;
void generateExtractionMark(const Node *node, ExtractionMarkType markType);
void reportOrphans(const InnerNode* parent);