Fix a bug in qdoc where to look for index files.
authorJan-Arve Saether <jan-arve.saether@nokia.com>
Mon, 3 Sep 2012 08:25:01 +0000 (10:25 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 7 Sep 2012 13:39:31 +0000 (15:39 +0200)
This was only a problem if the qdocconf file was in the same
directory as the current directory (QDir::relativeFilePath()
returns an empty string in that case), so if the documentation was
generated with the makefile rules, this problem did not reveal itself.

Change-Id: I9c8956fdb46c4f307df7ab297dc94e8d3ef93fb4
Reviewed-by: Martin Smith <martin.smith@nokia.com>
src/tools/qdoc/main.cpp

index 3cc36e4..0d66820 100644 (file)
@@ -264,7 +264,9 @@ static void processQdocconfFile(const QString &fileName)
         if (indexDirs.size() > 0) {
             for (int i = 0; i < indexDirs.size(); i++) {
                 if (indexDirs[i].startsWith("..")) {
-                    indexDirs[i].prepend(QDir(dir).relativeFilePath(prevCurrentDir) + QLatin1Char('/'));
+                    const QString prefix(QDir(dir).relativeFilePath(prevCurrentDir));
+                    if (!prefix.isEmpty())
+                        indexDirs[i].prepend(prefix + QLatin1Char('/'));
                 }
             }
             /*