diff options
author | Martin Smith <martin.smith@nokia.com> | 2010-07-07 08:50:58 (GMT) |
---|---|---|
committer | Martin Smith <martin.smith@nokia.com> | 2010-07-07 08:50:58 (GMT) |
commit | 0ad74254d0810459bc08fdf9c0898a0d73f596b0 (patch) | |
tree | 8e3f8726c5633c9d273c1088790ed88e649c20f5 /tools | |
parent | 5171e13e340493db1e295dd0e92f87a2a1a3a8d0 (diff) | |
download | Qt-0ad74254d0810459bc08fdf9c0898a0d73f596b0.zip Qt-0ad74254d0810459bc08fdf9c0898a0d73f596b0.tar.gz Qt-0ad74254d0810459bc08fdf9c0898a0d73f596b0.tar.bz2 |
qdoc: Removed a lot of dead code to minimize confusion.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 229 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.h | 6 |
2 files changed, 1 insertions, 234 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 4461b48..b7ab4d6 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -346,17 +346,6 @@ QString HtmlGenerator::format() */ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) { -#if 0 - // Copy the stylesheets from the directory containing the qdocconf file. - // ### This should be changed to use a special directory in doc/src. - QStringList::ConstIterator styleIter = stylesheets.begin(); - QDir configPath = QDir::current(); - while (styleIter != stylesheets.end()) { - QString filePath = configPath.absoluteFilePath(*styleIter); - Config::copyFile(Location(), filePath, filePath, outputDir()); - ++styleIter; - } -#endif myTree = tree; nonCompatClasses.clear(); mainClasses.clear(); @@ -371,9 +360,6 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) findAllFunctions(tree->root()); findAllLegaleseTexts(tree->root()); findAllNamespaces(tree->root()); -#ifdef ZZZ_QDOC_QML - findAllQmlClasses(tree->root()); -#endif findAllSince(tree->root()); PageGenerator::generateTree(tree, marker); @@ -1259,30 +1245,6 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, subtitleText << "(" << Atom(Atom::AutoLink, fullTitle) << ")" << Atom(Atom::LineBreak); -#if 0 - // No longer used because the modeule name is a breadcrumb. - QString fixedModule = inner->moduleName(); - if (fixedModule == "Qt3SupportLight") - fixedModule = "Qt3Support"; - if (!fixedModule.isEmpty()) - subtitleText << "[" << Atom(Atom::AutoLink, fixedModule) << " module]"; - - if (fixedModule.isEmpty()) { - QMultiMap<QString, QString> publicGroups = myTree->publicGroups(); - QList<QString> groupNames = publicGroups.values(inner->name()); - if (!groupNames.isEmpty()) { - qSort(groupNames.begin(), groupNames.end()); - subtitleText << "["; - for (int j=0; j<groupNames.count(); j++) { - subtitleText << Atom(Atom::AutoLink, groupNames[j]); - if (j<groupNames.count()-1) - subtitleText <<", "; - } - subtitleText << "]"; - } - } -#endif - generateHeader(title, inner, marker); sections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay); generateTableOfContents(inner,marker,§ions); @@ -1853,7 +1815,7 @@ void HtmlGenerator::generateHeader(const QString& title, generateBreadCrumbs(title,node,marker); out() << QString(postPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); -#if 0 // Removed for new docf format. MWS +#if 0 // Removed for new doc format. MWS if (node && !node->links().empty()) out() << "<p>\n" << navigationLinks << "</p>\n"; #endif @@ -2665,19 +2627,7 @@ void HtmlGenerator::generateQmlItem(const Node *node, marked.replace("<@type>", ""); marked.replace("</@type>", ""); } - if (node->type() == Node::QmlProperty) { - const QmlPropertyNode* qpn = static_cast<const QmlPropertyNode*>(node); - if (!summary && qpn->name() == "color" && qpn->dataType() == "color") { - if (relative && relative->name() == "GradientStop") { - qDebug() << "color : color"; - debugging_on = true; - qDebug() << " " << relative->name() << relative->type() << relative->subType(); - qDebug() << marked; - } - } - } out() << highlightedCode(marked, marker, relative, false, node); - debugging_on = false; } #endif @@ -3069,13 +3019,6 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, if (parseArg(src, typeTag, &i, srcSize, &arg, &par1)) { par1 = QStringRef(); const Node* n = marker->resolveTarget(arg.toString(), myTree, relative, self); - if (HtmlGenerator::debugging_on) { - qDebug() << "arg.toString()" << arg.toString(); - if (n) { - qDebug() << " " << n->name() << n->type() << n->subType(); - qDebug() << " " << relative->name() << relative->type() << relative->subType(); - } - } addLink(linkForNode(n,relative), arg, &html); handled = true; } @@ -3681,13 +3624,6 @@ void HtmlGenerator::findAllSince(const InnerNode *node) } } -#if 0 - const QRegExp versionSeparator("[\\-\\.]"); - const int minorIndex = version.indexOf(versionSeparator); - const int patchIndex = version.indexOf(versionSeparator, minorIndex+1); - version = version.left(patchIndex); -#endif - void HtmlGenerator::findAllFunctions(const InnerNode *node) { NodeList::ConstIterator c = node->childNodes().begin(); @@ -3751,29 +3687,6 @@ void HtmlGenerator::findAllNamespaces(const InnerNode *node) } } -#ifdef ZZZ_QDOC_QML -/*! - This function finds all the qml element nodes and - stores them in a map for later use. - */ -void HtmlGenerator::findAllQmlClasses(const InnerNode *node) -{ - NodeList::const_iterator c = node->childNodes().constBegin(); - while (c != node->childNodes().constEnd()) { - if ((*c)->type() == Node::Fake) { - const FakeNode* fakeNode = static_cast<const FakeNode *>(*c); - if (fakeNode->subType() == Node::QmlClass) { - const QmlClassNode* qmlNode = - static_cast<const QmlClassNode*>(fakeNode); - const Node* n = qmlNode->classNode(); - } - qmlClasses.insert(fakeNode->name(),*c); - } - ++c; - } -} -#endif - int HtmlGenerator::hOffset(const Node *node) { switch (node->type()) { @@ -3782,12 +3695,6 @@ int HtmlGenerator::hOffset(const Node *node) return 2; case Node::Fake: return 1; -#if 0 - if (node->doc().briefText().isEmpty()) - return 1; - else - return 2; -#endif case Node::Enum: case Node::Typedef: case Node::Function: @@ -4461,138 +4368,4 @@ void HtmlGenerator::generatePageIndex(const QString& fileName, CodeMarker* marke #endif -#if 0 // fossil removed for new doc format MWS 19/04/2010 - out() << "<!DOCTYPE html\n" - " PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"DTD/xhtml1-strict.dtd\">\n"; - out() << QString("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"%1\" lang=\"%1\">\n").arg(naturalLanguage); - - QString shortVersion; - if ((project != "Qtopia") && (project != "Qt Extended")) { - shortVersion = project + " " + shortVersion + ": "; - if (node && !node->doc().location().isEmpty()) - out() << "<!-- " << node->doc().location().fileName() << " -->\n"; - - shortVersion = myTree->version(); - if (shortVersion.count(QChar('.')) == 2) - shortVersion.truncate(shortVersion.lastIndexOf(QChar('.'))); - if (!shortVersion.isEmpty()) { - if (project == "QSA") - shortVersion = "QSA " + shortVersion + ": "; - else - shortVersion = "Qt " + shortVersion + ": "; - } - } - - out() << "<head>\n" - " <title>" << shortVersion << protectEnc(title) << "</title>\n"; - out() << QString("<meta http-equiv=\"Content-type\" content=\"text/html; charset=%1\" />").arg(outputEncoding); - - if (!style.isEmpty()) - out() << " <style type=\"text/css\">" << style << "</style>\n"; - - const QMap<QString, QString> &metaMap = node->doc().metaTagMap(); - if (!metaMap.isEmpty()) { - QMapIterator<QString, QString> i(metaMap); - while (i.hasNext()) { - i.next(); - out() << " <meta name=\"" << protectEnc(i.key()) << "\" contents=\"" - << protectEnc(i.value()) << "\" />\n"; - } - } - - navigationLinks.clear(); - - if (node && !node->links().empty()) { - QPair<QString,QString> linkPair; - QPair<QString,QString> anchorPair; - const Node *linkNode; - - if (node->links().contains(Node::PreviousLink)) { - linkPair = node->links()[Node::PreviousLink]; - linkNode = findNodeForTarget(linkPair.first, node, marker); - if (!linkNode || linkNode == node) - anchorPair = linkPair; - else - anchorPair = anchorForNode(linkNode); - - out() << " <link rel=\"prev\" href=\"" - << anchorPair.first << "\" />\n"; - - navigationLinks += "[Previous: <a href=\"" + anchorPair.first + "\">"; - if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) - navigationLinks += protectEnc(anchorPair.second); - else - navigationLinks += protectEnc(linkPair.second); - navigationLinks += "</a>]\n"; - } - if (node->links().contains(Node::ContentsLink)) { - linkPair = node->links()[Node::ContentsLink]; - linkNode = findNodeForTarget(linkPair.first, node, marker); - if (!linkNode || linkNode == node) - anchorPair = linkPair; - else - anchorPair = anchorForNode(linkNode); - - out() << " <link rel=\"contents\" href=\"" - << anchorPair.first << "\" />\n"; - - navigationLinks += "[<a href=\"" + anchorPair.first + "\">"; - if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) - navigationLinks += protectEnc(anchorPair.second); - else - navigationLinks += protectEnc(linkPair.second); - navigationLinks += "</a>]\n"; - } - if (node->links().contains(Node::NextLink)) { - linkPair = node->links()[Node::NextLink]; - linkNode = findNodeForTarget(linkPair.first, node, marker); - if (!linkNode || linkNode == node) - anchorPair = linkPair; - else - anchorPair = anchorForNode(linkNode); - - out() << " <link rel=\"next\" href=\"" - << anchorPair.first << "\" />\n"; - - navigationLinks += "[Next: <a href=\"" + anchorPair.first + "\">"; - if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) - navigationLinks += protectEnc(anchorPair.second); - else - navigationLinks += protectEnc(linkPair.second); - navigationLinks += "</a>]\n"; - } - if (node->links().contains(Node::IndexLink)) { - linkPair = node->links()[Node::IndexLink]; - linkNode = findNodeForTarget(linkPair.first, node, marker); - if (!linkNode || linkNode == node) - anchorPair = linkPair; - else - anchorPair = anchorForNode(linkNode); - out() << " <link rel=\"index\" href=\"" - << anchorPair.first << "\" />\n"; - } - if (node->links().contains(Node::StartLink)) { - linkPair = node->links()[Node::StartLink]; - linkNode = findNodeForTarget(linkPair.first, node, marker); - if (!linkNode || linkNode == node) - anchorPair = linkPair; - else - anchorPair = anchorForNode(linkNode); - out() << " <link rel=\"start\" href=\"" - << anchorPair.first << "\" />\n"; - } - } - - foreach (const QString &stylesheet, stylesheets) { - out() << " <link href=\"" << stylesheet << "\" rel=\"stylesheet\" " - << "type=\"text/css\" />\n"; - } - - foreach (const QString &customHeadElement, customHeadElements) { - out() << " " << customHeadElement << "\n"; - } - - out() << "</head>\n" - #endif - QT_END_NAMESPACE diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index a2fadf6..9c5be15 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -237,9 +237,6 @@ class HtmlGenerator : public PageGenerator void findAllFunctions(const InnerNode *node); void findAllLegaleseTexts(const InnerNode *node); void findAllNamespaces(const InnerNode *node); -#ifdef ZZZ_QDOC_QML - void findAllQmlClasses(const InnerNode *node); -#endif void findAllSince(const InnerNode *node); static int hOffset(const Node *node); static bool isThreeColumnEnumValueTable(const Atom *atom); @@ -317,9 +314,6 @@ class HtmlGenerator : public PageGenerator NodeMap obsoleteClasses; NodeMap namespaceIndex; NodeMap serviceClasses; -#ifdef QDOC_QML - NodeMap qmlClasses; -#endif QMap<QString, NodeMap > funcIndex; QMap<Text, const Node *> legaleseTexts; NewSinceMaps newSinceMaps; |