From 495b3d357de9adcdd5378b2457b0a88dfc97e7f4 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 6 Mar 2015 10:32:16 +0100 Subject: [PATCH] qdoc: Fix regression in Node type testing When support for documenting JavaScript was added to qdoc, some tests qdoc uses to determine whether an entity is a QML signal or a QML method were modified incorrectly, a case of premature optimization. This caused QML methods to be listed as QML signals in the documentation. This update corrects those tests. Change-Id: Ie6d5b43a03a6f3ae39982292cb9ad92952de0bff Task-number: QTBUG-44825 Reviewed-by: Gunnar Sletta --- src/tools/qdoc/node.h | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h index 5eeb7e7d3d..73b705dd0f 100644 --- a/src/tools/qdoc/node.h +++ b/src/tools/qdoc/node.h @@ -884,12 +884,24 @@ public: bool isOverload() const { return ove; } bool isReimp() const Q_DECL_OVERRIDE { return reimp; } bool isFunction() const Q_DECL_OVERRIDE { return true; } - virtual bool isQmlSignal() const Q_DECL_OVERRIDE { return genus() == Node::QML; } - virtual bool isJsSignal() const Q_DECL_OVERRIDE { return genus() == Node::JS; } - virtual bool isQmlSignalHandler() const Q_DECL_OVERRIDE { return genus() == Node::QML; } - virtual bool isJsSignalHandler() const Q_DECL_OVERRIDE { return genus() == Node::JS; } - virtual bool isQmlMethod() const Q_DECL_OVERRIDE { return genus() == Node::QML; } - virtual bool isJsMethod() const Q_DECL_OVERRIDE { return genus() == Node::JS; } + virtual bool isQmlSignal() const Q_DECL_OVERRIDE { + return (type() == Node::QmlSignal) && (genus() == Node::QML); + } + virtual bool isJsSignal() const Q_DECL_OVERRIDE { + return (type() == Node::QmlSignal) && (genus() == Node::JS); + } + virtual bool isQmlSignalHandler() const Q_DECL_OVERRIDE { + return (type() == Node::QmlSignalHandler) && (genus() == Node::QML); + } + virtual bool isJsSignalHandler() const Q_DECL_OVERRIDE { + return (type() == Node::QmlSignalHandler) && (genus() == Node::JS); + } + virtual bool isQmlMethod() const Q_DECL_OVERRIDE { + return (type() == Node::QmlMethod) && (genus() == Node::QML); + } + virtual bool isJsMethod() const Q_DECL_OVERRIDE { + return (type() == Node::QmlMethod) && (genus() == Node::JS); + } int overloadNumber() const; const QList& parameters() const { return params; } QStringList parameterNames() const;