From b34d9b67fbdc6bf74f7ada972dd9b35153f47202 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 29 May 2009 13:43:48 +0200 Subject: Added the -showinternal flag to qdoc. When you set -showinternal on the command line, qdoc will include everything marked \internal in the documentation. This flag is not very useful at the moment for two reasons: (1) It generates hundreds of qdoc errors because most of the things marked with \internal don't have any documentation anyway, or the documentation has other errors in it that weren't being detected because of the \internal. (2) There is a bus error toward the end, which I haven't tracked down yet. For now, use -showinternal at your own risk. --- tools/qdoc3/codeparser.cpp | 14 +++++++++----- tools/qdoc3/codeparser.h | 1 + tools/qdoc3/config.h | 1 + tools/qdoc3/main.cpp | 22 +++++++++++++++------- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/tools/qdoc3/codeparser.cpp b/tools/qdoc3/codeparser.cpp index f0ff27e..20b37a0 100644 --- a/tools/qdoc3/codeparser.cpp +++ b/tools/qdoc3/codeparser.cpp @@ -47,6 +47,7 @@ #include "codeparser.h" #include "node.h" #include "tree.h" +#include "config.h" QT_BEGIN_NAMESPACE @@ -67,6 +68,7 @@ QT_BEGIN_NAMESPACE #define COMMAND_TITLE Doc::alias(QLatin1String("title")) QList CodeParser::parsers; +bool CodeParser::showInternal = false; /*! The constructor adds this code parser to the static @@ -87,11 +89,11 @@ CodeParser::~CodeParser() } /*! - Initializing a code parser is trivial. + Initialize the code parser base class. */ -void CodeParser::initializeParser(const Config & /* config */) +void CodeParser::initializeParser(const Config& config) { - // nothing. + showInternal = config.getBool(QLatin1String(CONFIG_SHOWINTERNAL)); } /*! @@ -217,8 +219,10 @@ void CodeParser::processCommonMetaCommand(const Location &location, node->setStatus(Node::Preliminary); } else if (command == COMMAND_INTERNAL) { - node->setAccess(Node::Private); - node->setStatus(Node::Internal); + if (!showInternal) { + node->setAccess(Node::Private); + node->setStatus(Node::Internal); + } } else if (command == COMMAND_REENTRANT) { node->setThreadSafeness(Node::Reentrant); diff --git a/tools/qdoc3/codeparser.h b/tools/qdoc3/codeparser.h index 019e806..0152b9c 100644 --- a/tools/qdoc3/codeparser.h +++ b/tools/qdoc3/codeparser.h @@ -87,6 +87,7 @@ class CodeParser private: static QList parsers; + static bool showInternal; }; QT_END_NAMESPACE diff --git a/tools/qdoc3/config.h b/tools/qdoc3/config.h index 9443f0d..7eb7048 100644 --- a/tools/qdoc3/config.h +++ b/tools/qdoc3/config.h @@ -147,6 +147,7 @@ class Config #define CONFIG_QHP "qhp" #define CONFIG_QUOTINGINFORMATION "quotinginformation" #define CONFIG_SLOW "slow" +#define CONFIG_SHOWINTERNAL "showinternal" #define CONFIG_SOURCEDIRS "sourcedirs" #define CONFIG_SOURCES "sources" #define CONFIG_SPURIOUS "spurious" diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp index 514d06e..995d037 100644 --- a/tools/qdoc3/main.cpp +++ b/tools/qdoc3/main.cpp @@ -95,6 +95,7 @@ static const struct { }; static bool slow = false; +static bool showInternal = false; static QStringList defines; static QHash trees; @@ -120,14 +121,16 @@ static void printHelp() { Location::information(tr("Usage: qdoc [options] file1.qdocconf ...\n" "Options:\n" - " -help " + " -help " "Display this information and exit\n" - " -version " + " -version " "Display version of qdoc and exit\n" - " -D " + " -D " "Define as a macro while parsing sources\n" - " -slow " - "Turn on features that slow down qdoc") ); + " -slow " + "Turn on features that slow down qdoc" + " -showinternal " + "Include stuff marked internal") ); } /*! @@ -160,6 +163,8 @@ static void processQdocconfFile(const QString &fileName) ++i; } config.setStringList(CONFIG_SLOW, QStringList(slow ? "true" : "false")); + config.setStringList(CONFIG_SHOWINTERNAL, + QStringList(showInternal ? "true" : "false")); /* With the default configuration values in place, load @@ -326,10 +331,11 @@ static void processQdocconfFile(const QString &fileName) /* Generate the XML tag file, if it was requested. */ + QString tagFile = config.getString(CONFIG_TAGFILE); if (!tagFile.isEmpty()) tree->generateTagFile(tagFile); - + tree->setVersion(""); Generator::terminate(); CodeParser::terminate(); @@ -342,7 +348,6 @@ static void processQdocconfFile(const QString &fileName) foreach (QTranslator *translator, translators) delete translator; - delete tree; } @@ -426,6 +431,9 @@ int main(int argc, char **argv) else if (opt == "-slow") { slow = true; } + else if (opt == "-showinternal") { + showInternal = true; + } else { qdocFiles.append(opt); } -- cgit v0.12