From 894b579e3492dfa33832841fc9115d40d5b7595c Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 27 Oct 2014 14:19:08 +0100 Subject: [PATCH] qdoc: Fixed a link generation regression This update fixes a bug introduced in the original update for this task. The bug caused some links to be generated incorrectly. If the name of the file containing the target began with the module name, then a test that asks if the link already begins with the module name fails, and the link is generated incorrectly. The test now checks for the module name followed by a slash, which it should have done in the first place. Change-Id: Iebac228ac969cef875678b15a248a2a1198ace05 Task-number: QTBUG-41705 Reviewed-by: Martin Smith --- src/tools/qdoc/htmlgenerator.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index cbd8c1ddef4..ca58be57c7c 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -3717,7 +3717,6 @@ QString HtmlGenerator::getLink(const Atom *atom, const Node *relative, const Nod *node = qdb_->findNodeForAtom(atom, relative, ref); if (!(*node)) return QString(); - if (Generator::writeQaPages()) qdb_->incrementLinkCount(*node); @@ -3838,10 +3837,12 @@ QString HtmlGenerator::linkForNode(const Node *node, const Node *relative) if (node && relative && (node != relative)) { if (useOutputSubdirs() && !node->isExternalPage() && node->outputSubdirectory() != relative->outputSubdirectory()) { - if (link.startsWith(node->outputSubdirectory())) + if (link.startsWith(QString(node->outputSubdirectory() + QLatin1Char('/')))) { link.prepend(QString("../")); - else + } + else { link.prepend(QString("../" + node->outputSubdirectory() + QLatin1Char('/'))); + } } } return link;