From 0ad74254d0810459bc08fdf9c0898a0d73f596b0 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 7 Jul 2010 10:50:58 +0200 Subject: qdoc: Removed a lot of dead code to minimize confusion. --- tools/qdoc3/htmlgenerator.cpp | 229 +----------------------------------------- tools/qdoc3/htmlgenerator.h | 6 -- 2 files changed, 1 insertion(+), 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 publicGroups = myTree->publicGroups(); - QList groupNames = publicGroups.values(inner->name()); - if (!groupNames.isEmpty()) { - qSort(groupNames.begin(), groupNames.end()); - subtitleText << "["; - for (int j=0; jsections(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() << "

\n" << navigationLinks << "

\n"; #endif @@ -2665,19 +2627,7 @@ void HtmlGenerator::generateQmlItem(const Node *node, marked.replace("<@type>", ""); marked.replace("", ""); } - if (node->type() == Node::QmlProperty) { - const QmlPropertyNode* qpn = static_cast(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(*c); - if (fakeNode->subType() == Node::QmlClass) { - const QmlClassNode* qmlNode = - static_cast(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() << "\n"; - out() << QString("\n").arg(naturalLanguage); - - QString shortVersion; - if ((project != "Qtopia") && (project != "Qt Extended")) { - shortVersion = project + " " + shortVersion + ": "; - if (node && !node->doc().location().isEmpty()) - out() << "\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() << "\n" - " " << shortVersion << protectEnc(title) << "\n"; - out() << QString("").arg(outputEncoding); - - if (!style.isEmpty()) - out() << " \n"; - - const QMap &metaMap = node->doc().metaTagMap(); - if (!metaMap.isEmpty()) { - QMapIterator i(metaMap); - while (i.hasNext()) { - i.next(); - out() << " \n"; - } - } - - navigationLinks.clear(); - - if (node && !node->links().empty()) { - QPair linkPair; - QPair 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() << " \n"; - - navigationLinks += "[Previous: "; - if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) - navigationLinks += protectEnc(anchorPair.second); - else - navigationLinks += protectEnc(linkPair.second); - navigationLinks += "]\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() << " \n"; - - navigationLinks += "["; - if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) - navigationLinks += protectEnc(anchorPair.second); - else - navigationLinks += protectEnc(linkPair.second); - navigationLinks += "]\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() << " \n"; - - navigationLinks += "[Next: "; - if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) - navigationLinks += protectEnc(anchorPair.second); - else - navigationLinks += protectEnc(linkPair.second); - navigationLinks += "]\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() << " \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() << " \n"; - } - } - - foreach (const QString &stylesheet, stylesheets) { - out() << " \n"; - } - - foreach (const QString &customHeadElement, customHeadElements) { - out() << " " << customHeadElement << "\n"; - } - - out() << "\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 funcIndex; QMap legaleseTexts; NewSinceMaps newSinceMaps; -- cgit v0.12