diff options
| author | Martin Smith <[email protected]> | 2013-08-07 11:40:27 +0200 |
|---|---|---|
| committer | The Qt Project <[email protected]> | 2013-08-08 08:58:07 +0200 |
| commit | bc87acaa1f72d907c68aa6fdb1586191eee8aead (patch) | |
| tree | 719e15bdb254de06b1082cb3045229b7f6775c29 /src/tools/qdoc/main.cpp | |
| parent | 097942d328cb405a74c14ee0a501640b1390b2d8 (diff) | |
qdoc: Restore support for output in one directory
The basic functionality is working. Add these lines
to qt-html-templates-offline.qdocconf, or add them
to the online version:
HTML.nosubdirs = "true"
HTML.outputsubdir = "html"
Before it opens a .html file for writing, it tests
whether the file alread exists. If so, it writes an
error message, e.g.:
...platform-notes.qdoc:140: error: HTML file already exists;
overwriting .../doc/html/platform-notes-windows.html
There are currently nearly 100 files being overwritten for Qt5.
Task-number: QTBUG-32580
Change-Id: I02b103fd00b9d1e624665ac518d571acc791be9d
Reviewed-by: Jerome Pasion <[email protected]>
Diffstat (limited to 'src/tools/qdoc/main.cpp')
| -rw-r--r-- | src/tools/qdoc/main.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp index ef8a6fd9c5e..e163246e847 100644 --- a/src/tools/qdoc/main.cpp +++ b/src/tools/qdoc/main.cpp @@ -165,6 +165,13 @@ 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"); + } + // Allow modules and third-party application/libraries to link // to the Qt docs without having to explicitly pass --indexdir. if (!indexDirs.contains(documentationPath)) @@ -199,8 +206,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)) |
