Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/tools/qdoc3/codemarker.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information ([email protected])
     4** All rights reserved.
     5** Contact: Nokia Corporation ([email protected])
    56**
    67** This file is part of the tools applications of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
     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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    169169    if (sizeof(const Node *) == sizeof(uint)) {
    170170        return reinterpret_cast<const Node *>(string.toUInt());
    171     } else {
     171    }
     172    else {
    172173        return reinterpret_cast<const Node *>(string.toULongLong());
    173174    }
     
    178179    if (sizeof(const Node *) == sizeof(ulong)) {
    179180        return QString::number(reinterpret_cast<ulong>(node));
    180     } else {
     181    }
     182    else {
    181183        return QString::number(reinterpret_cast<qulonglong>(node));
    182184    }
     
    221223                || ch == QLatin1Char(':')) {
    222224            pendingWord += ch;
    223         } else {
     225        }
     226        else {
    224227            if (!pendingWord.isEmpty()) {
    225228                bool isProbablyType = (pendingWord != QLatin1String("const"));
     
    252255}
    253256
    254 QString CodeMarker::taggedNode(const Node *node)
     257QString CodeMarker::taggedNode(const Nodenode)
    255258{
    256259    QString tag;
     
    277280    default:
    278281        tag = QLatin1String("@unknown");
     282
    279283    }
    280284    return QLatin1Char('<') + tag + QLatin1Char('>') + protect(node->name())
    281285        + QLatin1String("</") + tag + QLatin1Char('>');
    282286}
     287
     288
     289
     290
     291
     292
     293
     294
     295
     296
     297
     298
     299
     300
     301
     302
     303
     304
     305
     306
     307
     308
     309
    283310
    284311QString CodeMarker::linkTag(const Node *node, const QString& body)
     
    309336        if (func->metaness() == FunctionNode::Ctor) {
    310337            sortNo = QLatin1String("C");
    311         } else if (func->metaness() == FunctionNode::Dtor) {
     338        }
     339        else if (func->metaness() == FunctionNode::Dtor) {
    312340            sortNo = QLatin1String("D");
    313         } else {
     341        }
     342        else {
    314343            if (nodeName.startsWith(QLatin1String("operator"))
    315344                    && nodeName.length() > 8
     
    332361}
    333362
    334 void CodeMarker::insert(FastSection &fastSection, Node *node, SynopsisStyle style, Status status)
    335 {
    336     bool inheritedMember = (!node->relates() &&
    337                             (node->parent() != (const InnerNode *)fastSection.innerNode));
     363void CodeMarker::insert(FastSection &fastSection,
     364                        Node *node,
     365                        SynopsisStyle style,
     366                        Status status)
     367{
    338368    bool irrelevant = false;
     369
     370
     371
     372
     373
     374
     375
    339376
    340377    if (node->access() == Node::Private) {
    341378        irrelevant = true;
    342     } else if (node->type() == Node::Function) {
     379    }
     380    else if (node->type() == Node::Function) {
    343381        FunctionNode *func = (FunctionNode *) node;
    344382        irrelevant = (inheritedMember
    345383                      && (func->metaness() == FunctionNode::Ctor ||
    346384                          func->metaness() == FunctionNode::Dtor));
    347     } else if (node->type() == Node::Class || node->type() == Node::Enum
     385    }
     386    else if (node->type() == Node::Class || node->type() == Node::Enum
    348387                    || node->type() == Node::Typedef) {
    349388        irrelevant = (inheritedMember && style != SeparateList);
     
    358397        if (status == Compat) {
    359398            irrelevant = (node->status() != Node::Compat);
    360         } else if (status == Obsolete) {
     399        }
     400        else if (status == Obsolete) {
    361401            irrelevant = (node->status() != Node::Obsolete);
    362         } else {
     402        }
     403        else {
    363404            irrelevant = (node->status() == Node::Compat ||
    364405                          node->status() == Node::Obsolete);
     
    371412            if (!fastSection.memberMap.contains(key))
    372413                fastSection.memberMap.insert(key, node);
    373         } else {
     414        }
     415        else {
    374416            if (node->parent()->type() == Node::Class) {
    375417                if (fastSection.inherited.isEmpty()
     
    384426}
    385427
    386 void CodeMarker::append(QList<Section>& sectionList,
    387                         const FastSection& fastSection)
    388 {
    389     if (!fastSection.memberMap.isEmpty() ||
    390          !fastSection.inherited.isEmpty()) {
    391         Section section(fastSection.name,
    392                         fastSection.singularMember,
    393                         fastSection.pluralMember);
    394         section.members = fastSection.memberMap.values();
    395         section.inherited = fastSection.inherited;
     428/*!
     429  Returns true if \a node represents a reimplemented member function.
     430  If it is, then it is inserted in the reimplemented member map in the
     431  section \a fs. And, the test is only performed if \a status is \e OK.
     432  Otherwise, false is returned.
     433 */
     434bool CodeMarker::insertReimpFunc(FastSection& fs, Node* node, Status status)
     435{
     436    if (node->access() == Node::Private)
     437        return false;
     438
     439    const FunctionNode* fn = static_cast<const FunctionNode*>(node);
     440    if ((fn->reimplementedFrom() != 0) && (status == Okay)) {
     441        bool inherited = (!fn->relates() && (fn->parent() != (const InnerNode*)fs.innerNode));
     442        if (!inherited) {
     443            QString key = sortName(fn);
     444            if (!fs.reimpMemberMap.contains(key)) {
     445                fs.reimpMemberMap.insert(key,node);
     446                return true;
     447            }
     448        }
     449    }
     450    return false;
     451 }
     452
     453/*!
     454  If \a fs is not empty, convert it to a Section and append
     455  the new Section to \a sectionList.
     456 */
     457void CodeMarker::append(QList<Section>& sectionList, const FastSection& fs)
     458{
     459    if (!fs.isEmpty()) {
     460        Section section(fs.name,fs.singularMember,fs.pluralMember);
     461        section.members = fs.memberMap.values();
     462        section.reimpMembers = fs.reimpMemberMap.values();
     463        section.inherited = fs.inherited;
    396464        sectionList.append(section);
    397465    }
     
    429497            if (!classe->templateStuff().isEmpty()) {
    430498                 result += QLatin1String("tmplt/");
    431             } else
     499            }
     500            else
    432501#endif
    433502            {
     
    466535                isMacro = true;
    467536#if 0
    468             } else if (!func->templateStuff().isEmpty()) {
     537            }
     538            else if (!func->templateStuff().isEmpty()) {
    469539                result += QLatin1String("ftmplt/");
    470540#endif
    471             } else if (func->isStatic()) {
     541            }
     542            else if (func->isStatic()) {
    472543                result += QLatin1String("clm/");
    473             } else if (!func->parent()->name().isEmpty()) {
     544            }
     545            else if (!func->parent()->name().isEmpty()) {
    474546                result += QLatin1String("instm/");
    475             } else {
     547            }
     548            else {
    476549                result += QLatin1String("func/");
    477550            }
     
    487560                const QList<Parameter> &params = func->parameters();
    488561                for (int i = 0; i < params.count(); ++i) {
    489                     QString type = params.at(i).leftType() + params.at(i).rightType();
     562                    QString type = params.at(i).leftType() +
     563                        params.at(i).rightType();
    490564                    type = QLatin1String(QMetaObject::normalizedSignature(type.toLatin1().constData()));
    491565                    if (i != 0)
     
    529603
    530604    if (node->name().isEmpty()) {
    531         return QLatin1Char('/') + myName;
    532     } else {
    533         return plainFullName(node) + QLatin1Char('/') + myName;
    534     }
    535 }
    536 
     605        return QLatin1Char('/') + protect(myName);
     606    }
     607    else {
     608        return plainFullName(node) + QLatin1Char('/') + protect(myName);
     609    }
     610}
     611
     612#ifdef QDOC_QML
     613/*!
     614  Get the list of documentation sections for the children of
     615  the specified QmlClassNode.
     616 */
     617QList<Section> CodeMarker::qmlSections(const QmlClassNode* , SynopsisStyle )
     618{
     619    return QList<Section>();
     620}
     621#endif
    537622
    538623QT_END_NAMESPACE
Note: See TracChangeset for help on using the changeset viewer.