diff options
author | Casper van Donderen <casper.vandonderen@nokia.com> | 2012-05-30 10:44:04 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-30 11:13:55 +0200 |
commit | 60fb770fa779864015f728556857b1d70398fb74 (patch) | |
tree | 40ce10627bcd4563ef6555f541fd0b89b67d175a /src/tools | |
parent | 28ae5aa332f00920bd29d876159d6b92922798dc (diff) |
QDoc: Add support for 'all subfolders' in dependant modules.
It is now possible to use '*' when specifying the 'depends' qdocconf
variable, this will automatically load all index files found in
subdirectories of the index dirs.
Change-Id: I94b140df27da8d987824005a1dcf2a9348d5cd9e
Reviewed-by: Martin Smith <martin.smith@nokia.com>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/qdoc/main.cpp | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp index 34ef2135a2..f33b95c97a 100644 --- a/src/tools/qdoc/main.cpp +++ b/src/tools/qdoc/main.cpp @@ -254,12 +254,29 @@ static void processQdocconfFile(const QString &fileName) if (dependModules.size() > 0) { if (indexDirs.size() > 0) { - for (int j = 0; j < indexDirs.size(); j++) { - if (indexDirs[j].startsWith("..")) { - indexDirs[j].prepend(QDir(dir).relativeFilePath(prevCurrentDir)); + for (int i = 0; i < indexDirs.size(); i++) { + if (indexDirs[i].startsWith("..")) { + indexDirs[i].prepend(QDir(dir).relativeFilePath(prevCurrentDir)); + } + } + /* + Add all subdirectories of the indexdirs as dependModules when an asterisk is used in + the 'depends' list. + */ + if (dependModules.contains("*")) { + dependModules.removeOne("*"); + for (int i = 0; i < indexDirs.size(); i++) { + QDir scanDir = QDir(indexDirs[i]); + scanDir.setFilter(QDir::Dirs | QDir::NoDotAndDotDot); + QFileInfoList dirList = scanDir.entryInfoList(); + for (int j = 0; j < dirList.size(); j++) { + if (dirList[j].fileName().toLower() != config.getString(CONFIG_PROJECT).toLower()) + dependModules.append(dirList[j].fileName()); + } } } for (int i = 0; i < dependModules.size(); i++) { + QString indexToAdd; QMultiMap<uint, QFileInfo> foundIndices; for (int j = 0; j < indexDirs.size(); j++) { QString fileToLookFor = indexDirs[j] + QLatin1Char('/') + dependModules[i] + @@ -279,16 +296,18 @@ static void processQdocconfFile(const QString &fileName) qDebug() << "Using" << foundIndices.value( foundIndices.keys()[foundIndices.size() - 1]).absoluteFilePath() << "as index for" << dependModules[i]; - indexFiles << foundIndices.value( + indexToAdd = foundIndices.value( foundIndices.keys()[foundIndices.size() - 1]).absoluteFilePath(); } else if (foundIndices.size() == 1) { - indexFiles << foundIndices.value(foundIndices.keys()[0]).absoluteFilePath(); + indexToAdd = foundIndices.value(foundIndices.keys()[0]).absoluteFilePath(); } else { qDebug() << "No indices for" << dependModules[i] << "could be found in the specified index directories."; } + if (!indexToAdd.isEmpty() && !indexFiles.contains(indexToAdd)) + indexFiles << indexToAdd; } } else { |