Changeset 846 for trunk/tools/qdoc3/main.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/tools/qdoc3/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 45 45 46 46 #include <qglobal.h> 47 #include <QtCore>48 47 #include <stdlib.h> 49 48 #include "apigenerator.h" … … 70 69 #include "sgmlgenerator.h" 71 70 #include "webxmlgenerator.h" 71 #include "ditaxmlgenerator.h" 72 72 #include "tokenizer.h" 73 73 #include "tree.h" 74 #include <qdebug.h> 75 76 #include "qtranslator.h" 77 #ifndef QT_BOOTSTRAPPED 78 # include "qcoreapplication.h" 79 #endif 74 80 75 81 QT_BEGIN_NAMESPACE … … 100 106 static QStringList defines; 101 107 static QHash<QString, Tree *> trees; 108 static QString appArg; // application 102 109 103 110 /*! … … 142 149 static void printVersion() 143 150 { 144 QString s = QString(tr("qdoc version ")) + QString(QT_VERSION_STR);151 QString s = tr("qdoc version %1").arg(QT_VERSION_STR); 145 152 Location::information(s); 146 153 } … … 152 159 static void processQdocconfFile(const QString &fileName) 153 160 { 161 #ifndef QT_NO_TRANSLATION 154 162 QList<QTranslator *> translators; 163 #endif 155 164 156 165 /* … … 183 192 Location::initialize(config); 184 193 config.load(fileName); 194 195 /* 196 Set the application to which qdoc will create the output. 197 The two applications are: 198 199 creator: additional formatting for viewing in 200 the Creator application. 201 202 online: full-featured online version with search and 203 links to Qt topics 204 */ 205 if (appArg.isEmpty()) { 206 qDebug() << "Warning: Application flag not specified on" 207 << "command line. Options are -creator (default)" 208 << "and -online."; 209 appArg = "creator"; 210 } 211 config.setStringList(CONFIG_APPLICATION, QStringList(appArg)); 185 212 186 213 /* … … 208 235 Generator::initialize(config); 209 236 237 #ifndef QT_NO_TRANSLATION 210 238 /* 211 239 Load the language translators, if the configuration specifies any. … … 222 250 ++fn; 223 251 } 252 #endif 224 253 225 254 //QSet<QString> outputLanguages = config.getStringSet(CONFIG_OUTPUTLANGUAGES); … … 338 367 */ 339 368 QString tagFile = config.getString(CONFIG_TAGFILE); 340 if (!tagFile.isEmpty()) 369 if (!tagFile.isEmpty()) { 341 370 tree->generateTagFile(tagFile); 371 } 342 372 343 373 tree->setVersion(""); … … 351 381 QDir::setCurrent(prevCurrentDir); 352 382 353 foreach (QTranslator *translator, translators) 354 delete translator; 383 #ifndef QT_NO_TRANSLATION 384 qDeleteAll(translators); 385 #endif 386 #ifdef DEBUG_SHUTDOWN_CRASH 387 qDebug() << "main(): Delete tree"; 388 #endif 355 389 delete tree; 390 #ifdef DEBUG_SHUTDOWN_CRASH 391 qDebug() << "main(): Tree deleted"; 392 #endif 356 393 } 357 394 … … 362 399 QT_USE_NAMESPACE 363 400 401 #ifndef QT_BOOTSTRAPPED 364 402 QCoreApplication app(argc, argv); 403 #endif 365 404 QString cf = "qsauncompress \1 \2"; 366 405 PolyArchiveExtractor qsaExtractor(QStringList() << "qsa",cf); … … 409 448 SgmlGenerator smglGenerator; 410 449 WebXMLGenerator webxmlGenerator; 450 DitaXmlGenerator ditaxmlGenerator; 411 451 412 452 QStringList qdocFiles; … … 442 482 obsoleteLinks = true; 443 483 } 484 else if (opt == "-creator") 485 appArg = "creator"; 486 else if (opt == "-online") 487 appArg = "online"; 444 488 else { 445 489 qdocFiles.append(opt); … … 447 491 } 448 492 449 493 if (qdocFiles.isEmpty()) { 450 494 printHelp(); 451 495 return EXIT_FAILURE; … … 455 499 Main loop. 456 500 */ 457 foreach (QString qf, qdocFiles) 501 foreach (QString qf, qdocFiles) { 502 //qDebug() << "PROCESSING:" << qf; 458 503 processQdocconfFile(qf); 504 } 459 505 460 506 qDeleteAll(trees);
Note:
See TracChangeset
for help on using the changeset viewer.