diff options
author | Topi Reinio <[email protected]> | 2015-10-16 11:51:22 +0200 |
---|---|---|
committer | Topi Reiniƶ <[email protected]> | 2015-10-21 09:52:29 +0000 |
commit | 70b229d996d45a661fe70fdb18909ad0e364f7ba (patch) | |
tree | 365eca104ee5d0167908b5730623f86508a6c6f1 /src/tools/qdoc/qdocindexfiles.cpp | |
parent | d159fe199fd50845fd20b00da0962c060479fe4c (diff) |
qdoc: Minor optimizations
Remove unnecessary type casts in qdocindexfiles.cpp, and reduce the
amount of duplicate string literals used for generating QML
documentation.
Change-Id: Ia6d68a44fad14bd7414c0106e8752999830c93e8
Reviewed-by: Martin Smith <[email protected]>
Diffstat (limited to 'src/tools/qdoc/qdocindexfiles.cpp')
-rw-r--r-- | src/tools/qdoc/qdocindexfiles.cpp | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp index ef86d782c7a..b466f59819d 100644 --- a/src/tools/qdoc/qdocindexfiles.cpp +++ b/src/tools/qdoc/qdocindexfiles.cpp @@ -315,15 +315,7 @@ void QDocIndexFiles::readIndexSection(QXmlStreamReader& reader, bool readonly = false; if (attributes.value(QLatin1String("writable")) == QLatin1String("false")) readonly = true; - QmlPropertyNode* qpn = 0; - if (parent->isQmlType()) { - QmlTypeNode* qcn = static_cast<QmlTypeNode*>(parent); - qpn = new QmlPropertyNode(qcn, name, type, attached); - } - else if (parent->isQmlPropertyGroup()) { - QmlPropertyGroupNode* qpgn = static_cast<QmlPropertyGroupNode*>(parent); - qpn = new QmlPropertyNode(qpgn, name, type, attached); - } + QmlPropertyNode* qpn = new QmlPropertyNode(parent, name, type, attached); qpn->setReadOnly(readonly); node = qpn; } @@ -335,15 +327,7 @@ void QDocIndexFiles::readIndexSection(QXmlStreamReader& reader, bool readonly = false; if (attributes.value(QLatin1String("writable")) == QLatin1String("false")) readonly = true; - QmlPropertyNode* qpn = 0; - if (parent->isJsType()) { - QmlTypeNode* qcn = static_cast<QmlTypeNode*>(parent); - qpn = new QmlPropertyNode(qcn, name, type, attached); - } - else if (parent->isJsPropertyGroup()) { - QmlPropertyGroupNode* qpgn = static_cast<QmlPropertyGroupNode*>(parent); - qpn = new QmlPropertyNode(qpgn, name, type, attached); - } + QmlPropertyNode* qpn = new QmlPropertyNode(parent, name, type, attached); qpn->setGenus(Node::JS); qpn->setReadOnly(readonly); node = qpn; |