qdoc: Removed "../" from paths to images
authorMartin Smith <martin.smith@nokia.com>
Mon, 6 Aug 2012 10:42:58 +0000 (12:42 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 6 Aug 2012 14:04:06 +0000 (16:04 +0200)
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>
src/tools/qdoc/ditaxmlgenerator.cpp
src/tools/qdoc/htmlgenerator.cpp

index f9506ff..0d99177 100644 (file)
@@ -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('/')));
+                }
             }
         }
     }
index 46e5d0a..5e412f4 100644 (file)
@@ -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('/')));
+                }
             }
         }
     }