summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/qdoc/main.cpp')
-rw-r--r--src/tools/qdoc/main.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp
index 3ec121f795..912cdad7eb 100644
--- a/src/tools/qdoc/main.cpp
+++ b/src/tools/qdoc/main.cpp
@@ -95,6 +95,7 @@ bool creationTimeBefore(const QFileInfo &fi1, const QFileInfo &fi2)
static bool highlighting = false;
static bool showInternal = false;
+static bool redirectDocumentationToDevNull = false;
static bool noLinkErrors = false;
static bool obsoleteLinks = false;
static QStringList defines;
@@ -139,6 +140,8 @@ static void printHelp()
"Run qdoc to read the index files and generate the docs\n"
" -showinternal "
"Include content marked internal\n"
+ " -redirect-documentation-to-dev-null "
+ "Save all documentation content to /dev/null. Useful if someone is interested in qdoc errors only.\n"
" -version "
"Display version of qdoc and exit\n") );
}
@@ -162,6 +165,15 @@ static void loadIndexFiles(Config& config)
dependModules += config.getStringList(CONFIG_DEPENDS);
+ bool noOutputSubdirs = false;
+ QString singleOutputSubdir;
+ if (config.getBool(QString("HTML.nosubdirs"))) {
+ noOutputSubdirs = true;
+ singleOutputSubdir = config.getString("HTML.outputsubdir");
+ if (singleOutputSubdir.isEmpty())
+ singleOutputSubdir = "html";
+ }
+
// Allow modules and third-party application/libraries to link
// to the Qt docs without having to explicitly pass --indexdir.
if (!indexDirs.contains(documentationPath))
@@ -196,8 +208,12 @@ static void loadIndexFiles(Config& config)
QString indexToAdd;
QList<QFileInfo> foundIndices;
for (int j = 0; j < indexDirs.size(); j++) {
- QString fileToLookFor = indexDirs[j] + QLatin1Char('/') + dependModules[i] +
- QLatin1Char('/') + dependModules[i] + QLatin1String(".index");
+ QString fileToLookFor = indexDirs[j] + QLatin1Char('/');
+ if (noOutputSubdirs)
+ fileToLookFor += singleOutputSubdir + QLatin1Char('/');
+ else
+ fileToLookFor += dependModules[i] + QLatin1Char('/');
+ fileToLookFor += dependModules[i] + QLatin1String(".index");
if (QFile::exists(fileToLookFor)) {
QFileInfo tempFileInfo(fileToLookFor);
if (!foundIndices.contains(tempFileInfo))
@@ -257,6 +273,7 @@ static void processQdocconfFile(const QString &fileName)
}
config.setStringList(CONFIG_SYNTAXHIGHLIGHTING, QStringList(highlighting ? "true" : "false"));
config.setStringList(CONFIG_SHOWINTERNAL, QStringList(showInternal ? "true" : "false"));
+ config.setStringList(CONFIG_REDIRECTDOCUMENTATIONTODEVNULL, QStringList(redirectDocumentationToDevNull ? "true" : "false"));
config.setStringList(CONFIG_NOLINKERRORS, QStringList(noLinkErrors ? "true" : "false"));
config.setStringList(CONFIG_OBSOLETELINKS, QStringList(obsoleteLinks ? "true" : "false"));
@@ -573,6 +590,9 @@ int main(int argc, char **argv)
else if (opt == "-showinternal") {
showInternal = true;
}
+ else if (opt == "-redirect-documentation-to-dev-null") {
+ redirectDocumentationToDevNull = true;
+ }
else if (opt == "-no-examples") {
Config::generateExamples = false;
}