diff options
author | Jerome Pasion <jerome.pasion@nokia.com> | 2010-08-03 07:49:14 (GMT) |
---|---|---|
committer | Jerome Pasion <jerome.pasion@nokia.com> | 2010-08-03 07:49:14 (GMT) |
commit | a53b98f9269e6ee0b524fe7477e8fb46f189f9d3 (patch) | |
tree | 45f3e545ca84e7601703535e4e58c530bf84dab3 /tools/qdoc3/main.cpp | |
parent | 6d872ce4f906e16d2da2c2511da5b6d065c3367f (diff) | |
download | Qt-a53b98f9269e6ee0b524fe7477e8fb46f189f9d3.zip Qt-a53b98f9269e6ee0b524fe7477e8fb46f189f9d3.tar.gz Qt-a53b98f9269e6ee0b524fe7477e8fb46f189f9d3.tar.bz2 |
Made changes to qdoc to allow it to accept a "style level" flag
Diffstat (limited to 'tools/qdoc3/main.cpp')
-rw-r--r-- | tools/qdoc3/main.cpp | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp index 616ae2f..44f9572 100644 --- a/tools/qdoc3/main.cpp +++ b/tools/qdoc3/main.cpp @@ -105,6 +105,8 @@ static bool showInternal = false; static bool obsoleteLinks = false; static QStringList defines; static QHash<QString, Tree *> trees; +static QString application = "base"; //application +static bool applicationArg = 0; //if 1, then the argument is provided and it will override the qdocconf file /*! Find the Tree for language \a lang and return a pointer to it. @@ -192,6 +194,38 @@ static void processQdocconfFile(const QString &fileName) config.load(fileName); /* + Set the application to which qdoc will create the output. + The three applications are: + base: simple, basic html output. Best suited for offline viewing + creator: additional formatting. + online: full-featured online version with search and links to Qt topics + + Note: This will override the offline, online, creator defines. + */ + if(applicationArg == false){ + + QString appConfig = config.getString(CONFIG_APPLICATION); + if (!appConfig.isEmpty()){ + application = appConfig; + } + } + if(application == "online"){ + config.setStringList(CONFIG_ONLINE, QStringList("true")); + config.setStringList(CONFIG_OFFLINE, QStringList("false")); + config.setStringList(CONFIG_CREATOR, QStringList("false")); + } + else if(application == "creator"){ + config.setStringList(CONFIG_ONLINE, QStringList("false")); + config.setStringList(CONFIG_OFFLINE, QStringList("true")); + config.setStringList(CONFIG_CREATOR, QStringList("false")); + } + else if(application == "base"){ + config.setStringList(CONFIG_ONLINE, QStringList("false")); + config.setStringList(CONFIG_OFFLINE, QStringList("false")); + config.setStringList(CONFIG_CREATOR, QStringList("true")); + } + + /* Add the defines to the configuration variables. */ QStringList defs = defines + config.getStringList(CONFIG_DEFINES); @@ -462,12 +496,24 @@ int main(int argc, char **argv) else if (opt == "-obsoletelinks") { obsoleteLinks = true; } + else if (opt == "-base") { + application = "base"; + applicationArg = true; + } + else if (opt == "-creator") { + application = "creator"; + applicationArg = true; + } + else if (opt == "-online") { + application = "online"; + applicationArg = true; + } else { qdocFiles.append(opt); } } - if (qdocFiles.isEmpty()) { + if (qdocFiles.isEmpty()) { printHelp(); return EXIT_FAILURE; } |