qdoc: Handle extra imahes exactly like styles
authorMartin Smith <martin.smith@digia.com>
Fri, 16 Nov 2012 13:47:45 +0000 (14:47 +0100)
committerJerome Pasion <jerome.pasion@digia.com>
Fri, 16 Nov 2012 13:57:59 +0000 (14:57 +0100)
The values of the extraimages variable in the qdocconf file
must now be paths that are relative to the location of
the qdocconf file, just like for styles. They can be
absolute paths, of course, but if they are relative,
they must be relative to the qdocconf file containing
the extraimages variable.

The extraimages variable is for including images used
in the HTML heard and footer that are not referred to
in the documentation.

Task-number: QTBUG-27878
Change-Id: If5e0d1dee7ba231a9c1a73f02a1bbaeb7bfe52c8
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
src/tools/qdoc/generator.cpp

index 882af2a..2854aed 100644 (file)
@@ -1528,21 +1528,14 @@ void Generator::initialize(const Config &config)
         if (outputFormats.contains((*g)->format())) {
             currentGenerator_ = (*g);
             (*g)->initializeGenerator(config);
-            QStringList extraImages =
-                config.getCleanPathList(CONFIG_EXTRAIMAGES+Config::dot+(*g)->format());
+            QStringList extraImages = config.getCleanPathList((*g)->format() +
+                                                              Config::dot +
+                                                              CONFIG_EXTRAIMAGES);
             QStringList::ConstIterator e = extraImages.constBegin();
             while (e != extraImages.constEnd()) {
-                QString userFriendlyFilePath;
-                QString filePath = Config::findFile(config.lastLocation(),
-                                                    imageFiles,
-                                                    imageDirs,
-                                                    *e,
-                                                    imgFileExts[(*g)->format()],
-                                                    userFriendlyFilePath);
+                QString filePath = *e;
                 if (!filePath.isEmpty())
-                    Config::copyFile(config.lastLocation(),
-                                     filePath,
-                                     userFriendlyFilePath,
+                    Config::copyFile(config.lastLocation(), filePath, filePath,
                                      (*g)->outputDir() + "/images");
                 ++e;
             }
@@ -1553,9 +1546,7 @@ void Generator::initialize(const Config &config)
             while (e != scripts.constEnd()) {
                 QString filePath = *e;
                 if (!filePath.isEmpty())
-                    Config::copyFile(config.lastLocation(),
-                                     filePath,
-                                     filePath,
+                    Config::copyFile(config.lastLocation(), filePath, filePath,
                                      (*g)->outputDir() + "/scripts");
                 ++e;
             }
@@ -1565,9 +1556,7 @@ void Generator::initialize(const Config &config)
             while (e != styles.constEnd()) {
                 QString filePath = *e;
                 if (!filePath.isEmpty())
-                    Config::copyFile(config.lastLocation(),
-                                     filePath,
-                                     filePath,
+                    Config::copyFile(config.lastLocation(), filePath, filePath,
                                      (*g)->outputDir() + "/style");
                 ++e;
             }