summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/htmlgenerator.cpp
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2014-03-04 12:55:59 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-09 12:12:55 +0100
commitd87ddcf56ff3bc46f468d8da276f1afc28b6ac26 (patch)
treed3892472b771cc58abc6b80b155ae3ff05aedb0b /src/tools/qdoc/htmlgenerator.cpp
parentcfb4581feef2058a3b1b31b6bd4cfeef2c01339d (diff)
qdoc: Improve navigation bar for example files
For example file pages, added a link to the parent example page into the navigation bar. Also, - Removed protectEnc() calls for strings added as Text atoms, this is done automatically when generating the navigation bar output, and doing it twice results in malformed output. - Removed the subtitle from being appended to example file title. The subtitle contains the full path of the file and it's already displayed on the page body, so removing it from the html title + navigation bar makes for a cleaner look without losing any information. Task-number: QTBUG-33022 Change-Id: I3ca942470453379e22f1a4aaec1d9b866d85bb5c Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Diffstat (limited to 'src/tools/qdoc/htmlgenerator.cpp')
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp
index 1eef42dc2f..641e59f018 100644
--- a/src/tools/qdoc/htmlgenerator.cpp
+++ b/src/tools/qdoc/htmlgenerator.cpp
@@ -1439,11 +1439,7 @@ void HtmlGenerator::generateDocNode(DocNode* dn, CodeMarker* marker)
QString fullTitle = dn->fullTitle();
QString htmlTitle = fullTitle;
- if (dn->subType() == Node::File && !dn->subTitle().isEmpty()) {
- subTitleSize = SmallSubTitle;
- htmlTitle += " (" + dn->subTitle() + QLatin1Char(')');
- }
- else if (dn->subType() == Node::QmlBasicType) {
+ if (dn->subType() == Node::QmlBasicType) {
fullTitle = "QML Basic Type: " + fullTitle;
htmlTitle = fullTitle;
@@ -1668,10 +1664,11 @@ void HtmlGenerator::generateNavigationBar(const QString &title,
if (!cn->name().isEmpty())
navigationbar << Atom(Atom::ListItemLeft)
- << Atom(Atom::String, protectEnc(cn->name()))
+ << Atom(Atom::String, cn->name())
<< Atom(Atom::ListItemRight);
}
else if (node->type() == Node::Document) {
+ const DocNode *dn = static_cast<const DocNode *>(node);
if (node->subType() == Node::QmlClass || node->subType() == Node::QmlBasicType) {
if (!qmltypespage.isEmpty())
navigationbar << Atom(Atom::ListItemLeft)
@@ -1680,16 +1677,19 @@ void HtmlGenerator::generateNavigationBar(const QString &title,
<< Atom(Atom::String, QLatin1String("QML Types"))
<< Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK)
<< Atom(Atom::ListItemRight);
-
- navigationbar << Atom(Atom::ListItemLeft)
- << Atom(Atom::String, protectEnc(title))
- << Atom(Atom::ListItemRight);
}
- else {
+ else if (dn && dn->isExampleFile()) {
navigationbar << Atom(Atom::ListItemLeft)
- << Atom(Atom::String, protectEnc(title))
- << Atom(Atom::ListItemRight);
+ << Atom(Atom::Link, dn->parent()->name())
+ << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
+ << Atom(Atom::String, dn->parent()->title())
+ << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK)
+ << Atom(Atom::ListItemRight);
+
}
+ navigationbar << Atom(Atom::ListItemLeft)
+ << Atom(Atom::String, title)
+ << Atom(Atom::ListItemRight);
}
generateText(navigationbar, node, marker);