From 70b229d996d45a661fe70fdb18909ad0e364f7ba Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 16 Oct 2015 11:51:22 +0200 Subject: 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 --- src/tools/qdoc/qdocindexfiles.cpp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'src/tools/qdoc/qdocindexfiles.cpp') 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(parent); - qpn = new QmlPropertyNode(qcn, name, type, attached); - } - else if (parent->isQmlPropertyGroup()) { - QmlPropertyGroupNode* qpgn = static_cast(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(parent); - qpn = new QmlPropertyNode(qcn, name, type, attached); - } - else if (parent->isJsPropertyGroup()) { - QmlPropertyGroupNode* qpgn = static_cast(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; -- cgit v1.2.3