diff options
author | Topi Reinio <topi.reinio@qt.io> | 2019-11-14 13:21:19 +0100 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2019-11-14 15:36:56 +0100 |
commit | 2b6c90317b6bc5f94ca0dc14a3a1467aa8019b17 (patch) | |
tree | baa9e5ed28b0332bd58ad8c56f86e5da8969da38 | |
parent | 2d17116ef67618a53fa1f48e6ef601fd3c5596da (diff) | |
download | qttools-2b6c90317b6bc5f94ca0dc14a3a1467aa8019b17.tar.gz |
qdoc: Allow a documentation project to load all available index files
QDoc recognized '*' as a valid input for the 'depends' qdocconf
variable, with the intent to load all available index files. This did
not work as we cleared the resolved dependencies by re-fetching
the depends string from Config after resolving the dependencies.
This fix is a backport of another commit that is targeted for the
dev branch, but this useful already for 5.14.
Fixes: QTBUG-80051
Change-Id: I1d752208078452f4b16b1d855cdb67b8cbabf1f4
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
-rw-r--r-- | src/qdoc/main.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/qdoc/main.cpp b/src/qdoc/main.cpp index 48166257d..c6552129f 100644 --- a/src/qdoc/main.cpp +++ b/src/qdoc/main.cpp @@ -128,8 +128,11 @@ static void loadIndexFiles(Config &config, const QSet<QString> &formats) Add all subdirectories of the indexdirs as dependModules, when an asterisk is used in the 'depends' list. */ + bool asteriskUsed = false; if (config.dependModules().contains("*")) { config.dependModules().removeOne("*"); + asteriskUsed = true; + Location::logToStdErrAlways("qdocconf file has depends = *; loading all index files found"); for (int i = 0; i < config.indexDirs().size(); i++) { QDir scanDir = QDir(config.indexDirs()[i]); scanDir.setFilter(QDir::Dirs | QDir::NoDotAndDotDot); @@ -183,7 +186,7 @@ static void loadIndexFiles(Config &config, const QSet<QString> &formats) if (!indexFiles.contains(indexToAdd)) indexFiles << indexToAdd; } - else { + else if (!asteriskUsed) { Location::null.warning(QString("\"%1\" Cannot locate index file for dependency \"%2\"").arg( config.getString(CONFIG_PROJECT), config.dependModules()[i])); } @@ -336,8 +339,11 @@ static void processQdocconfFile(const QString &fileName, Config &config) else clangParser_->setModuleHeader(project); - config.dependModules() = config.getStringList(CONFIG_DEPENDS); - config.dependModules().removeDuplicates(); + // Retrieve the dependencies if loadIndexFiles() was not called + if (config.dependModules().isEmpty()) { + config.dependModules() = config.getStringList(CONFIG_DEPENDS); + config.dependModules().removeDuplicates(); + } qdb->setSearchOrder(config.dependModules()); // Store the title of the index (landing) page |