From ba4d556e7c9f0f6f2c02893326eec76c21f46fc7 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 4 Jun 2009 12:34:31 +0200 Subject: qdoc: Put ... around accessor names. --- tools/qdoc3/htmlgenerator.cpp | 45 ++++++++++++++++++++++++++++--------------- tools/qdoc3/htmlgenerator.h | 1 + 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index a2a7184..ab26d08 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -447,21 +447,24 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << formattingRightMap()[ATOM_FORMATTING_TELETYPE]; break; case Atom::Code: - out() << "
" << trimmedTrailing(highlightedCode(indent(codeIndent, atom->string()),
-                                                            marker, relative))
+	out() << "
"
+              << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
+                                                 marker,relative))
               << "
\n"; break; #ifdef QDOC_QML case Atom::Qml: - out() << "
" << trimmedTrailing(highlightedCode(indent(codeIndent, atom->string()),
-                                                            marker, relative))
+	out() << "
"
+              << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
+                                                 marker,relative))
               << "
\n"; break; #endif case Atom::CodeNew: out() << "

you can rewrite it as

\n" - << "
" << trimmedTrailing(highlightedCode(indent(codeIndent, atom->string()),
-                                                            marker, relative))
+              << "
"
+              << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
+                                                 marker,relative))
               << "
\n"; break; case Atom::CodeOld: @@ -469,7 +472,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, // fallthrough case Atom::CodeBad: out() << "
"
-              << trimmedTrailing(protect(plainCode(indent(codeIndent, atom->string()))))
+              << trimmedTrailing(protect(plainCode(indent(codeIndent,atom->string()))))
               << "
\n"; break; case Atom::FootnoteLeft: @@ -1533,17 +1536,19 @@ void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker, void HtmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *marker) { if (!inner->includes().isEmpty()) { - out() << "
" << trimmedTrailing(highlightedCode(indent(codeIndent,
-                                                                   marker->markedUpIncludes(
-                                                                        inner->includes())),
-                                                                        marker, inner))
+        out() << "
"
+              << trimmedTrailing(highlightedCode(indent(codeIndent,
+                                                        marker->markedUpIncludes(inner->includes())),
+                                                 marker,inner))
               << "
"; } } -void HtmlGenerator::generateTableOfContents(const Node *node, CodeMarker *marker, +void HtmlGenerator::generateTableOfContents(const Node *node, + CodeMarker *marker, Doc::SectioningUnit sectioningUnit, - int numColumns, const Node *relative) + int numColumns, + const Node *relative) { if (!node->doc().hasTableOfContents()) @@ -2302,12 +2307,13 @@ void HtmlGenerator::generateSynopsis(const Node *node, marked.replace("<@type>", ""); marked.replace("", ""); } - out() << highlightedCode(marked, marker, relative, nameAlignment); + out() << highlightedCode(marked, marker, relative, style, nameAlignment); } QString HtmlGenerator::highlightedCode(const QString& markedCode, CodeMarker *marker, const Node *relative, + CodeMarker::SynopsisStyle style, bool nameAlignment) { QString src = markedCode; @@ -2320,15 +2326,24 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, // replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*()" static const QString linkTag("link"); + if (src.contains("setAcceptDrops")) + qDebug() << "SRC:" << src; + bool done = false; for (int i = 0, n = src.size(); i < n;) { if (src.at(i) == charLangle && src.at(i + 1).unicode() == '@') { - if (nameAlignment) // && (i != 0)) Why was this here? + if (nameAlignment && !done) {// && (i != 0)) Why was this here? html += ""; + done = true; + } i += 2; if (parseArg(src, linkTag, &i, n, &arg, &par1)) { + if (style == CodeMarker::Accessors) + html += ""; QString link = linkForNode( CodeMarker::nodeForString(par1.toString()), relative); addLink(link, arg, &html); + if (style == CodeMarker::Accessors) + html += ""; } else { html += charLangle; diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index ec9532f..36a2e30 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -158,6 +158,7 @@ class HtmlGenerator : public PageGenerator QString highlightedCode(const QString& markedCode, CodeMarker *marker, const Node *relative, + CodeMarker::SynopsisStyle style = CodeMarker::Accessors, bool nameAlignment = false); #else void generateSynopsis(const Node *node, -- cgit v0.12