Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/tools/qdoc3/main.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4545
    4646#include <qglobal.h>
    47 #include <QtCore>
    4847#include <stdlib.h>
    4948#include "apigenerator.h"
     
    7069#include "sgmlgenerator.h"
    7170#include "webxmlgenerator.h"
     71#include "ditaxmlgenerator.h"
    7272#include "tokenizer.h"
    7373#include "tree.h"
     74#include <qdebug.h>
     75
     76#include "qtranslator.h"
     77#ifndef QT_BOOTSTRAPPED
     78#  include "qcoreapplication.h"
     79#endif
    7480
    7581QT_BEGIN_NAMESPACE
     
    100106static QStringList defines;
    101107static QHash<QString, Tree *> trees;
     108static QString appArg; // application
    102109
    103110/*!
     
    142149static void printVersion()
    143150{
    144     QString s = QString(tr("qdoc version ")) + QString(QT_VERSION_STR);
     151    QString s = tr("qdoc version %1").arg(QT_VERSION_STR);
    145152    Location::information(s);
    146153}
     
    152159static void processQdocconfFile(const QString &fileName)
    153160{
     161#ifndef QT_NO_TRANSLATION
    154162    QList<QTranslator *> translators;
     163#endif
    155164
    156165    /*
     
    183192    Location::initialize(config);
    184193    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));
    185212
    186213    /*
     
    208235    Generator::initialize(config);
    209236
     237#ifndef QT_NO_TRANSLATION
    210238    /*
    211239      Load the language translators, if the configuration specifies any.
     
    222250        ++fn;
    223251    }
     252#endif
    224253
    225254    //QSet<QString> outputLanguages = config.getStringSet(CONFIG_OUTPUTLANGUAGES);
     
    338367     */
    339368    QString tagFile = config.getString(CONFIG_TAGFILE);
    340     if (!tagFile.isEmpty())
     369    if (!tagFile.isEmpty()) {
    341370        tree->generateTagFile(tagFile);
     371    }
    342372
    343373    tree->setVersion("");
     
    351381    QDir::setCurrent(prevCurrentDir);
    352382
    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   
    355389    delete tree;
     390#ifdef DEBUG_SHUTDOWN_CRASH   
     391    qDebug() << "main(): Tree deleted";
     392#endif
    356393}
    357394
     
    362399    QT_USE_NAMESPACE
    363400
     401#ifndef QT_BOOTSTRAPPED
    364402    QCoreApplication app(argc, argv);
     403#endif
    365404    QString cf = "qsauncompress \1 \2";
    366405    PolyArchiveExtractor qsaExtractor(QStringList() << "qsa",cf);
     
    409448    SgmlGenerator smglGenerator;
    410449    WebXMLGenerator webxmlGenerator;
     450    DitaXmlGenerator ditaxmlGenerator;
    411451
    412452    QStringList qdocFiles;
     
    442482            obsoleteLinks = true;
    443483        }
     484        else if (opt == "-creator")
     485                appArg = "creator";
     486        else if (opt == "-online")
     487                appArg = "online";
    444488        else {
    445489            qdocFiles.append(opt);
     
    447491    }
    448492
    449     if (qdocFiles.isEmpty()) {
     493        if (qdocFiles.isEmpty()) {
    450494        printHelp();
    451495        return EXIT_FAILURE;
     
    455499      Main loop.
    456500     */
    457     foreach (QString qf, qdocFiles)
     501    foreach (QString qf, qdocFiles) {
     502        //qDebug() << "PROCESSING:" << qf;
    458503        processQdocconfFile(qf);
     504    }
    459505
    460506    qDeleteAll(trees);
Note: See TracChangeset for help on using the changeset viewer.