summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@nokia.com>2012-08-06 12:42:58 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-06 16:04:06 +0200
commit7a64f2790eeee192f08b3fc139135e8b2c6b0ec9 (patch)
tree5496c4357110191a35580bb817ef303c1c27bff9 /src/tools
parent6f580d6a5ae9cb553aa8486499af35a46406c4c6 (diff)
qdoc: Removed "../" from paths to images
qdoc was mistakenly assuming that the output was going into subdirectories. The base dir variable was not being tested. Task nr: QTBUG-26638 Change-Id: I9b331926f8954b58102f75fad3f233eaebb2bb4d Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/qdoc/ditaxmlgenerator.cpp14
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp14
2 files changed, 16 insertions, 12 deletions
diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp
index f9506ff348..0d99177763 100644
--- a/src/tools/qdoc/ditaxmlgenerator.cpp
+++ b/src/tools/qdoc/ditaxmlgenerator.cpp
@@ -4222,12 +4222,14 @@ QString DitaXmlGenerator::getLink(const Atom* atom,
the link must go up to the parent directory and then
back down into the other subdirectory.
*/
- if (link.startsWith("images/")) {
- link.prepend(QString("../"));
- }
- else if (*node && relative && (*node != relative)) {
- if ((*node)->outputSubdirectory() != relative->outputSubdirectory()) {
- link.prepend(QString("../" + (*node)->outputSubdirectory() + QLatin1Char('/')));
+ if (!baseDir().isEmpty()) {
+ if (link.startsWith("images/")) {
+ link.prepend(QString("../"));
+ }
+ else if (*node && relative && (*node != relative)) {
+ if ((*node)->outputSubdirectory() != relative->outputSubdirectory()) {
+ link.prepend(QString("../" + (*node)->outputSubdirectory() + QLatin1Char('/')));
+ }
}
}
}
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp
index 46e5d0a4b5..5e412f446a 100644
--- a/src/tools/qdoc/htmlgenerator.cpp
+++ b/src/tools/qdoc/htmlgenerator.cpp
@@ -3823,12 +3823,14 @@ QString HtmlGenerator::getLink(const Atom *atom,
the link must go up to the parent directory and then
back down into the other subdirectory.
*/
- if (link.startsWith("images/")) {
- link.prepend(QString("../"));
- }
- else if (*node && relative && (*node != relative)) {
- if ((*node)->outputSubdirectory() != relative->outputSubdirectory()) {
- link.prepend(QString("../" + (*node)->outputSubdirectory() + QLatin1Char('/')));
+ if (!baseDir().isEmpty()) {
+ if (link.startsWith("images/")) {
+ link.prepend(QString("../"));
+ }
+ else if (*node && relative && (*node != relative)) {
+ if ((*node)->outputSubdirectory() != relative->outputSubdirectory()) {
+ link.prepend(QString("../" + (*node)->outputSubdirectory() + QLatin1Char('/')));
+ }
}
}
}