summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJerome Pasion <jerome.pasion@nokia.com>2010-08-03 07:49:14 (GMT)
committerJesper Thomschutz <jesper.thomschutz@nokia.com>2010-08-11 11:56:56 (GMT)
commitf41231f6a0cec06cdc8653cb424ca0d066469f12 (patch)
tree6da36aa907a56ff4b0986c21286ba7343180a5f4
parentc122bd5c6da90d801188131492d015040f865d18 (diff)
downloadQt-f41231f6a0cec06cdc8653cb424ca0d066469f12.zip
Qt-f41231f6a0cec06cdc8653cb424ca0d066469f12.tar.gz
Qt-f41231f6a0cec06cdc8653cb424ca0d066469f12.tar.bz2
Made changes to qdoc to allow it to accept a "style level" flag
(cherry picked from commit a53b98f9269e6ee0b524fe7477e8fb46f189f9d3)
-rw-r--r--tools/qdoc3/config.h1
-rw-r--r--tools/qdoc3/main.cpp48
2 files changed, 48 insertions, 1 deletions
diff --git a/tools/qdoc3/config.h b/tools/qdoc3/config.h
index b087b1c..7665f1a 100644
--- a/tools/qdoc3/config.h
+++ b/tools/qdoc3/config.h
@@ -119,6 +119,7 @@ class Config
};
#define CONFIG_ALIAS "alias"
+#define CONFIG_APPLICATION "application"
#define CONFIG_BASE "base" // ### don't document for now
#define CONFIG_CODEINDENT "codeindent"
#define CONFIG_DEFINES "defines"
diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp
index ba3e387..47a4b67 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;
}