diff options
author | Martin Smith <martin.smith@digia.com> | 2013-08-20 13:55:28 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-22 16:11:29 +0200 |
commit | e4df7fc75ad16412b9fbe800b2d7a0b94bbfe8a7 (patch) | |
tree | 57e94263c8bd13c68c40c46d63e48d7677ef5deb /src/tools/qdoc/doc.cpp | |
parent | d9b5cead974d486e015872e73f918f0e68dda96e (diff) |
qdoc: Fix the qdoc \include command
qdoc's \include command now works as expected.
This command is only for including a file that
contains qdoc comments that contain qdoc commands
to be processed by qdoc. The file to be included
should have the .qdocinc suffix, although qdoc
will accept any suffix now. The file must be in
one of the directories specified by the sourcedirs
variable in the qdocconf file.
Task-number: QTBUG-33046
Change-Id: I45ea08932b4218aae369469968117fb5132f764b
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Diffstat (limited to 'src/tools/qdoc/doc.cpp')
-rw-r--r-- | src/tools/qdoc/doc.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/tools/qdoc/doc.cpp b/src/tools/qdoc/doc.cpp index 4d6b0b1a2c..1e0c66cd08 100644 --- a/src/tools/qdoc/doc.cpp +++ b/src/tools/qdoc/doc.cpp @@ -125,6 +125,7 @@ enum { CMD_INCLUDE, CMD_INLINEIMAGE, CMD_INDEX, + CMD_INPUT, CMD_KEYWORD, CMD_L, CMD_LEGALESE, @@ -242,6 +243,7 @@ static struct { { "include", CMD_INCLUDE, 0 }, { "inlineimage", CMD_INLINEIMAGE, 0 }, { "index", CMD_INDEX, 0 }, // ### don't document for now + { "input", CMD_INPUT, 0 }, { "keyword", CMD_KEYWORD, 0 }, { "l", CMD_L, 0 }, { "legalese", CMD_LEGALESE, 0 }, @@ -923,6 +925,7 @@ void DocParser::parse(const QString& source, enterPara(Atom::ImportantLeft, Atom::ImportantRight); break; case CMD_INCLUDE: + case CMD_INPUT: { QString fileName = getArgument(); QString identifier = getRestOfLine(); @@ -1681,16 +1684,17 @@ void DocParser::insertTarget(const QString &target, bool keyword) void DocParser::include(const QString& fileName, const QString& identifier) { if (location().depth() > 16) - location().fatal(tr("Too many nested '\\%1's") - .arg(cmdName(CMD_INCLUDE))); + location().fatal(tr("Too many nested '\\%1's").arg(cmdName(CMD_INCLUDE))); QString userFriendlyFilePath; - // ### use current directory? + QString filePath = Doc::config()->getIncludeFilePath(fileName); +#if 0 QString filePath = Config::findFile(location(), sourceFiles, sourceDirs, fileName, userFriendlyFilePath); +#endif if (filePath.isEmpty()) { location().warning(tr("Cannot find qdoc include file '%1'").arg(fileName)); } @@ -3043,6 +3047,8 @@ const QStringMultiMap &Doc::metaTagMap() const return priv && priv->extra ? priv->extra->metaMap : *null_QStringMultiMap(); } +const Config* Doc::config_ = 0; + void Doc::initialize(const Config& config) { DocParser::tabSize = config.getInt(CONFIG_TABSIZE); @@ -3053,8 +3059,8 @@ void Doc::initialize(const Config& config) DocParser::quoting = config.getBool(CONFIG_QUOTINGINFORMATION); QmlClassNode::qmlOnly = config.getBool(CONFIG_QMLONLY); - QStringMap reverseAliasMap; + config_ = &config; QSet<QString> commands = config.subVars(CONFIG_ALIAS); QSet<QString>::ConstIterator c = commands.constBegin(); |