summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3/main.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@nokia.com>2010-08-05 09:51:23 (GMT)
committerMartin Smith <martin.smith@nokia.com>2010-08-05 09:51:23 (GMT)
commitd4dceca5dcd9252e09a421b65b318a7178049cd1 (patch)
treec267ad8f78c98bd24834d3cd7b2788f08d55add2 /tools/qdoc3/main.cpp
parent3d0b7905b18ada0e22e77b9c6670069dfd454adc (diff)
downloadQt-d4dceca5dcd9252e09a421b65b318a7178049cd1.zip
Qt-d4dceca5dcd9252e09a421b65b318a7178049cd1.tar.gz
Qt-d4dceca5dcd9252e09a421b65b318a7178049cd1.tar.bz2
qdoc: Cleaned up the application option specification and use.
The flags allowed on the command line are now: -online (default), -base, -assistant (same as -base), and -creator. If you don't specify one of these, you see a warning in the error output telling you that it didn't find an application flag and that it generated online docs by defualt.
Diffstat (limited to 'tools/qdoc3/main.cpp')
-rw-r--r--tools/qdoc3/main.cpp70
1 files changed, 27 insertions, 43 deletions
diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp
index 47a4b67..38b76a4 100644
--- a/tools/qdoc3/main.cpp
+++ b/tools/qdoc3/main.cpp
@@ -105,8 +105,7 @@ 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
+static QString appArg; // application
/*!
Find the Tree for language \a lang and return a pointer to it.
@@ -194,36 +193,25 @@ 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.
+ Set the application to which qdoc will create the output.
+ The three applications are:
+
+ base or assistant: simple, basic html output
+ for offline viewing in the Assistant application.
+
+ creator: additional formatting for viewing in
+ the Creator application.
+
+ online: full-featured online version with search and
+ links to Qt topics
*/
- 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"));
+ if (appArg.isEmpty()) {
+ qDebug() << "Warning: Application flag not specified on"
+ << "command line. Options are -assistant, -creator,"
+ << "and -online (default).";
+ appArg = "online";
}
+ config.setStringList(CONFIG_APPLICATION, QStringList(appArg));
/*
Add the defines to the configuration variables.
@@ -496,18 +484,14 @@ 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 if (opt == "-base")
+ appArg = "base";
+ else if (opt == "-assistant")
+ appArg = "assistant";
+ else if (opt == "-creator")
+ appArg = "creator";
+ else if (opt == "-online")
+ appArg = "online";
else {
qdocFiles.append(opt);
}
@@ -522,7 +506,7 @@ int main(int argc, char **argv)
Main loop.
*/
foreach (QString qf, qdocFiles) {
- qDebug() << "PROCESSING:" << qf;
+ //qDebug() << "PROCESSING:" << qf;
processQdocconfFile(qf);
}