summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@nokia.com>2011-05-16 09:28:00 (GMT)
committerTimo Turunen <timo.p.turunen@nokia.com>2011-08-30 07:01:57 (GMT)
commit7381c29d28261b64c8c953aae0041397658dc956 (patch)
treef7787d509f94316722a0a3a3523aa23588101d13 /tools
parentdad08f791a05890dc94f91d2154a334eb4359a8f (diff)
downloadQt-7381c29d28261b64c8c953aae0041397658dc956.zip
Qt-7381c29d28261b64c8c953aae0041397658dc956.tar.gz
Qt-7381c29d28261b64c8c953aae0041397658dc956.tar.bz2
qdoc: Fixed QTBUG-19338
(cherry picked from commit 1ea0e706981006c48ad16a1ff8051df03610f20b) Reapplied after bad v4.7.4 merge
Diffstat (limited to 'tools')
-rw-r--r--tools/qdoc3/ditaxmlgenerator.cpp5
-rw-r--r--tools/qdoc3/generator.cpp11
2 files changed, 11 insertions, 5 deletions
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp
index b801e1e..c49ff65 100644
--- a/tools/qdoc3/ditaxmlgenerator.cpp
+++ b/tools/qdoc3/ditaxmlgenerator.cpp
@@ -1199,7 +1199,10 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
Just output the href as if the image is in
the images directory...
*/
- fileName = QLatin1String("images/") + protectEnc(atom->string());
+ if (atom->string()[0] == '/')
+ fileName = QLatin1String("images") + atom->string();
+ else
+ fileName = QLatin1String("images/") + atom->string();
}
if (currentTag() != DT_xref)
diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp
index 3367301..6c92e54 100644
--- a/tools/qdoc3/generator.cpp
+++ b/tools/qdoc3/generator.cpp
@@ -783,10 +783,13 @@ QString Generator::imageFileName(const Node *relative, const QString& fileBase)
if (filePath.isEmpty())
return QString();
- return QLatin1String("images/")
- + Config::copyFile(relative->doc().location(),
- filePath, userFriendlyFilePath,
- outputDir() + QLatin1String("/images"));
+ QString path = Config::copyFile(relative->doc().location(),
+ filePath,
+ userFriendlyFilePath,
+ outputDir() + QLatin1String("/images"));
+ if (path[0] != '/')
+ return QLatin1String("images/") + path;
+ return QLatin1String("images") + path;
}
void Generator::setImageFileExtensions(const QStringList& extensions)