~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to tools/qdoc3/main.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/****************************************************************************
2
2
**
3
3
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
 
4
** All rights reserved.
4
5
** Contact: Nokia Corporation (qt-info@nokia.com)
5
6
**
6
7
** This file is part of the tools applications of the Qt Toolkit.
7
8
**
8
9
** $QT_BEGIN_LICENSE:LGPL$
9
 
** Commercial Usage
10
 
** Licensees holding valid Qt Commercial licenses may use this file in
11
 
** accordance with the Qt Commercial License Agreement provided with the
12
 
** Software or, alternatively, in accordance with the terms contained in
13
 
** a written agreement between you and Nokia.
 
10
** No Commercial Usage
 
11
** This file contains pre-release code and may not be distributed.
 
12
** You may use this file in accordance with the terms and conditions
 
13
** contained in the Technology Preview License Agreement accompanying
 
14
** this package.
14
15
**
15
16
** GNU Lesser General Public License Usage
16
17
** Alternatively, this file may be used under the terms of the GNU Lesser
20
21
** ensure the GNU Lesser General Public License version 2.1 requirements
21
22
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
22
23
**
23
 
** In addition, as a special exception, Nokia gives you certain
24
 
** additional rights. These rights are described in the Nokia Qt LGPL
25
 
** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
26
 
** package.
27
 
**
28
 
** GNU General Public License Usage
29
 
** Alternatively, this file may be used under the terms of the GNU
30
 
** General Public License version 3.0 as published by the Free Software
31
 
** Foundation and appearing in the file LICENSE.GPL included in the
32
 
** packaging of this file.  Please review the following information to
33
 
** ensure the GNU General Public License version 3.0 requirements will be
34
 
** met: http://www.gnu.org/copyleft/gpl.html.
35
 
**
36
 
** If you are unsure which license is appropriate for your use, please
37
 
** contact the sales department at http://www.qtsoftware.com/contact.
 
24
** In addition, as a special exception, Nokia gives you certain additional
 
25
** rights.  These rights are described in the Nokia Qt LGPL Exception
 
26
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
 
27
**
 
28
** If you have questions regarding the use of this file, please contact
 
29
** Nokia at qt-info@nokia.com.
 
30
**
 
31
**
 
32
**
 
33
**
 
34
**
 
35
**
 
36
**
 
37
**
38
38
** $QT_END_LICENSE$
39
39
**
40
40
****************************************************************************/
95
95
};
96
96
 
97
97
static bool slow = false;
 
98
static bool showInternal = false;
 
99
static bool obsoleteLinks = false;
98
100
static QStringList defines;
99
101
static QHash<QString, Tree *> trees;
100
102
 
101
 
//static int doxygen = 0;
102
 
 
103
103
/*!
104
104
  Find the Tree for language \a lang and return a pointer to it.
105
105
  If there is no Tree for language \a lang in the Tree table, add
122
122
{
123
123
    Location::information(tr("Usage: qdoc [options] file1.qdocconf ...\n"
124
124
                              "Options:\n"
125
 
                              "    -help     "
 
125
                              "    -help         "
126
126
                              "Display this information and exit\n"
127
 
                              "    -version  "
 
127
                              "    -version      "
128
128
                              "Display version of qdoc and exit\n"
129
 
                              "    -D<name>  "
 
129
                              "    -D<name>      "
130
130
                              "Define <name> as a macro while parsing sources\n"
131
 
                              "    -slow     "
132
 
                              "Turn on features that slow down qdoc") );
 
131
                              "    -slow         "
 
132
                              "Turn on features that slow down qdoc\n"
 
133
                              "    -showinternal "
 
134
                              "Include stuff marked internal\n"
 
135
                              "    -obsoletelinks "
 
136
                              "Report links from obsolete items to non-obsolete items") );
133
137
}
134
138
 
135
139
/*!
162
166
        ++i;
163
167
    }
164
168
    config.setStringList(CONFIG_SLOW, QStringList(slow ? "true" : "false"));
 
169
    config.setStringList(CONFIG_SHOWINTERNAL,
 
170
                         QStringList(showInternal ? "true" : "false"));
 
171
    config.setStringList(CONFIG_OBSOLETELINKS,
 
172
                         QStringList(obsoleteLinks ? "true" : "false"));
165
173
 
166
174
    /*
167
175
      With the default configuration values in place, load
224
232
    QString lang = config.getString(CONFIG_LANGUAGE);
225
233
    Location langLocation = config.lastLocation();
226
234
 
227
 
#ifdef QDOC2DOX    
228
 
    // qdoc -> doxygen
229
 
    if (doxygen == 2) {
230
 
        qDebug() << "READING anchors.txt";
231
 
        DoxWriter::readAnchors();
232
 
        qDebug() << "READING title maps";
233
 
        DoxWriter::readTitles();
234
 
        qDebug() << "READING member multimaps";
235
 
        DoxWriter::readMembers();
236
 
    }
237
 
#endif    
238
 
 
239
235
    /*
240
236
      Initialize the tree where all the parsed sources will be stored.
241
237
      The tree gets built as the source files are parsed, and then the
322
318
    tree->resolveGroups();
323
319
    tree->resolveTargets();
324
320
 
325
 
#ifdef QDOC2DOX    
326
 
    // qdoc -> doxygen
327
 
    if (doxygen == 1) {
328
 
        DoxWriter::writeAnchors();
329
 
        DoxWriter::writeTitles();
330
 
        DoxWriter::writeMembers();
331
 
    }
332
 
 
333
 
    if (doxygen == 0) {
334
 
#endif    
335
 
 
336
321
    /*
337
322
      Now the tree has been built, and all the stuff that needed
338
323
      resolving has been resolved. Now it is time to traverse
354
339
    QString tagFile = config.getString(CONFIG_TAGFILE);
355
340
    if (!tagFile.isEmpty())
356
341
        tree->generateTagFile(tagFile);
357
 
    
 
342
 
358
343
    tree->setVersion("");
359
344
    Generator::terminate();
360
 
 
361
 
#ifdef QDOC2DOX    
362
 
    }
363
 
#endif    
364
 
 
365
345
    CodeParser::terminate();
366
346
    CodeMarker::terminate();
367
347
    CppToQsConverter::terminate();
372
352
 
373
353
    foreach (QTranslator *translator, translators)
374
354
        delete translator;
375
 
 
376
355
    delete tree;
377
356
}
378
357
 
456
435
        else if (opt == "-slow") {
457
436
            slow = true;
458
437
        }
459
 
        
460
 
#ifdef QDOC2DOX        
461
 
        else if (opt == "-doxygen1") {
462
 
            // qdoc -> doxygen
463
 
            // Don't use this; it isn't ready yet.
464
 
            // Now it's a fossil.
465
 
            qDebug() << "doxygen pass 1";
466
 
            doxygen = 1;
467
 
            DoxWriter::setDoxPass(1);
468
 
        }
469
 
        else if (opt == "-doxygen2") {
470
 
            // qdoc -> doxygen
471
 
            // Don't use this; it isn't ready yet.
472
 
            // Now it's a fossil.
473
 
            qDebug() << "doxygen pass 2";
474
 
            doxygen = 2;
475
 
            DoxWriter::setDoxPass(2);
476
 
        }
477
 
#endif
478
 
        
 
438
        else if (opt == "-showinternal") {
 
439
            showInternal = true;
 
440
        }
 
441
        else if (opt == "-obsoletelinks") {
 
442
            obsoleteLinks = true;
 
443
        }
479
444
        else {
480
445
            qdocFiles.append(opt);
481
446
        }