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/generator.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)
     
    4343  generator.cpp
    4444*/
    45 #include <QtCore>
    4645#include <qdir.h>
    4746#include <qdebug.h>
     
    6867QStringList Generator::exampleDirs;
    6968QStringList Generator::exampleImgExts;
     69QStringList Generator::scriptFiles;
     70QStringList Generator::scriptDirs;
     71QStringList Generator::styleFiles;
     72QStringList Generator::styleDirs;
    7073QString Generator::outDir;
    7174QString Generator::project;
     
    126129            config.lastLocation().fatal(tr("Cannot create output directory '%1'")
    127130                                        .arg(outDir + "/images/used-in-examples"));
     131        if (!dirInfo.mkdir(outDir + "/scripts"))
     132            config.lastLocation().fatal(tr("Cannot create output directory '%1'")
     133                                        .arg(outDir + "/scripts"));
     134        if (!dirInfo.mkdir(outDir + "/style"))
     135            config.lastLocation().fatal(tr("Cannot create output directory '%1'")
     136                                        .arg(outDir + "/style"));
    128137    }
    129138
    130139    imageFiles = config.getStringList(CONFIG_IMAGES);
    131140    imageDirs = config.getStringList(CONFIG_IMAGEDIRS);
     141    scriptFiles = config.getStringList(CONFIG_SCRIPTS);
     142    scriptDirs = config.getStringList(CONFIG_SCRIPTDIRS);
     143    styleFiles = config.getStringList(CONFIG_STYLES);
     144    styleDirs = config.getStringList(CONFIG_STYLEDIRS);
    132145    exampleDirs = config.getStringList(CONFIG_EXAMPLEDIRS);
    133146    exampleImgExts = config.getStringList(CONFIG_EXAMPLES + Config::dot +
     
    167180                ++e;
    168181            }
     182
     183            QStringList noExts;
     184            QStringList scripts =
     185                config.getStringList(CONFIG_SCRIPTS+Config::dot+(*g)->format());
     186            e = scripts.begin();
     187            while (e != scripts.end()) {
     188                QString userFriendlyFilePath;
     189                QString filePath = Config::findFile(config.lastLocation(),
     190                                                    scriptFiles,
     191                                                    scriptDirs,
     192                                                    *e,
     193                                                    noExts,
     194                                                    userFriendlyFilePath);
     195                if (!filePath.isEmpty())
     196                    Config::copyFile(config.lastLocation(),
     197                                     filePath,
     198                                     userFriendlyFilePath,
     199                                     (*g)->outputDir() +
     200                                     "/scripts");
     201                ++e;
     202            }
     203
     204            QStringList styles =
     205                config.getStringList(CONFIG_STYLES+Config::dot+(*g)->format());
     206            e = styles.begin();
     207            while (e != styles.end()) {
     208                QString userFriendlyFilePath;
     209                QString filePath = Config::findFile(config.lastLocation(),
     210                                                    styleFiles,
     211                                                    styleDirs,
     212                                                    *e,
     213                                                    noExts,
     214                                                    userFriendlyFilePath);
     215                if (!filePath.isEmpty())
     216                    Config::copyFile(config.lastLocation(),
     217                                     filePath,
     218                                     userFriendlyFilePath,
     219                                     (*g)->outputDir() +
     220                                     "/style");
     221                ++e;
     222            }
    169223        }
    170224        ++g;
     
    228282    imageDirs.clear();
    229283    outDir = "";
     284    QmlClassNode::clear();
    230285}
    231286
     
    323378
    324379    if (node->type() == Node::Function) {
    325 #if 0       
     380#if 0
    326381        const FunctionNode *func = (const FunctionNode *) node;
    327382        if (func->isOverload() && func->metaness() != FunctionNode::Ctor)
    328383            generateOverload(node, marker);
    329 #endif       
     384#endif
    330385    }
    331386    else if (node->type() == Node::Fake) {
     
    348403                generateReimplementedFrom(func, marker);
    349404        }
    350        
     405
    351406        if (!generateText(node->doc().body(), node, marker))
    352407            if (node->isReimp())
     
    453508            if (func->reimplementedFrom() != 0)
    454509                generateReimplementedFrom(func, marker);
    455 #endif           
     510#endif
    456511        }
    457512    }
     
    545600  files comprising the example, and the list of images used
    546601  by the example. The images are copied into a subtree of
    547   \c{...doc/html/images/used-in-examples/...} 
     602  \c{...doc/html/images/used-in-examples/...}
    548603 */
    549604void Generator::generateFileList(const FakeNode* fake,
     
    641696    }
    642697#endif
    643 
    644 void Generator::generateModuleWarning(const ClassNode *classe,
    645                                       CodeMarker *marker)
    646 {
    647     QString module = classe->moduleName();
    648     if (!module.isEmpty()) {
    649         Text text;
    650         if (!editionModuleMap["DesktopLight"].contains(module)) {
    651             text << Atom::ParaLeft
    652                  << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD)
    653                  << "This class is not part of the Qt GUI Framework Edition."
    654                  << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD)
    655                  << Atom::ParaRight;
    656         }
    657         else if (module == "Qt3Support") {
    658             text << Atom::ParaLeft
    659                  << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD)
    660                  << "Note to Qt GUI Framework Edition users:"
    661                  << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD)
    662                  << " This class is only available in the "
    663                  << Atom(Atom::AutoLink, "Qt Full Framework Edition")
    664                  << "." << Atom::ParaRight;
    665         }
    666 
    667         generateText(text, classe, marker);
    668     }
    669 }
    670698
    671699QString Generator::indent(int level, const QString& markedCode)
     
    954982            NodeList::ConstIterator c = innerNode->childNodes().begin();
    955983            while (c != innerNode->childNodes().end()) {
    956                 switch ((*c)->threadSafeness()) {
    957                 case Node::Reentrant:
    958                     reentrant.append(*c);
    959                     if (threadSafeness == Node::ThreadSafe)
     984               
     985                if ((*c)->status() != Node::Obsolete){
     986                    switch ((*c)->threadSafeness()) {
     987                    case Node::Reentrant:
     988                        reentrant.append(*c);
     989                        if (threadSafeness == Node::ThreadSafe)
     990                            exceptions = true;
     991                        break;
     992                    case Node::ThreadSafe:
     993                        threadsafe.append(*c);
     994                        if (threadSafeness == Node::Reentrant)
     995                            exceptions = true;
     996                        break;
     997                    case Node::NonReentrant:
     998                        nonreentrant.append(*c);
    960999                        exceptions = true;
    961                     break;
    962                 case Node::ThreadSafe:
    963                     threadsafe.append(*c);
    964                     if (threadSafeness == Node::Reentrant)
    965                         exceptions = true;
    966                     break;
    967                 case Node::NonReentrant:
    968                     nonreentrant.append(*c);
    969                     exceptions = true;
    970                     break;
    971                 default:
    972                     break;
     1000                        break;
     1001                    default:
     1002                        break;
     1003                    }
    9731004                }
    9741005                ++c;
    9751006            }
    976             if (!exceptions) 
     1007            if (!exceptions)
    9771008                text << ".";
    9781009            else if (threadSafeness == Node::Reentrant) {
     
    10411072        text << Atom::ParaLeft
    10421073             << "This "
    1043              << typeString(node)
    1044              << " was introduced in ";
     1074             << typeString(node);
     1075        if (node->type() == Node::Enum)
     1076            text << " was introduced or modified in ";
     1077        else
     1078            text << " was introduced in ";
    10451079        if (project.isEmpty())
    10461080             text << "version";
     
    10611095         << "This function overloads ";
    10621096    QString t = node->name() + "()";
    1063     text << Atom::AutoLink << t 
     1097    text << Atom::AutoLink << t
    10641098         << Atom::ParaRight;
    10651099    generateText(text, node, marker);
     
    12141248}
    12151249
     1250void Generator::appendSortedQmlNames(Text& text,
     1251                                     const Node* base,
     1252                                     const NodeList& subs,
     1253                                     CodeMarker *marker)
     1254{
     1255    QMap<QString,Text> classMap;
     1256    int index = 0;
     1257
     1258#ifdef DEBUG_MULTIPLE_QDOCCONF_FILES
     1259    qDebug() << "Generator::appendSortedQmlNames():" << base->name() << "is inherited by...";
     1260#endif
     1261    for (int i = 0; i < subs.size(); ++i) {
     1262        Text t;
     1263#ifdef DEBUG_MULTIPLE_QDOCCONF_FILES
     1264        qDebug() << "    " << subs[i]->name();
     1265#endif
     1266        appendFullName(t, subs[i], base, marker);
     1267        classMap[t.toString().toLower()] = t;
     1268    }
     1269
     1270    QStringList names = classMap.keys();
     1271    names.sort();
     1272
     1273    foreach (const QString &name, names) {
     1274        text << classMap[name];
     1275        text << separator(index++, names.count());
     1276    }
     1277}
     1278
    12161279int Generator::skipAtoms(const Atom *atom, Atom::Type type) const
    12171280{
Note: See TracChangeset for help on using the changeset viewer.