diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-08-05 02:12:31 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-08-05 02:12:31 (GMT) |
commit | 5a98d58c1ed78262c20b05aa178a92b4a1a097df (patch) | |
tree | 00c8c459c2bdbf438a35e5087250319d4766fe29 /tools/qdoc3/main.cpp | |
parent | 7de5f19f0f62f181132394da6d7b2c8484cd42d9 (diff) | |
parent | 5749421fdaff0305d217712e3174c85a76b367c4 (diff) | |
download | Qt-5a98d58c1ed78262c20b05aa178a92b4a1a097df.zip Qt-5a98d58c1ed78262c20b05aa178a92b4a1a097df.tar.gz Qt-5a98d58c1ed78262c20b05aa178a92b4a1a097df.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'tools/qdoc3/main.cpp')
-rw-r--r-- | tools/qdoc3/main.cpp | 52 |
1 files changed, 50 insertions, 2 deletions
diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp index 616ae2f..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; } @@ -475,8 +521,10 @@ int main(int argc, char **argv) /* Main loop. */ - foreach (QString qf, qdocFiles) + foreach (QString qf, qdocFiles) { + qDebug() << "PROCESSING:" << qf; processQdocconfFile(qf); + } qDeleteAll(trees); return EXIT_SUCCESS; |