From 0114d40f9488170f1ff979e8fca994075dbc4b47 Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Tue, 29 Mar 2011 15:40:11 -0300 Subject: Remove workaround used to fix bug 540 ("Duplicate entries in QRegExp docs") as it's now really fixed. Reviewer: Marcelo Lira Luciano Wolf --- generators/qtdoc/qtdocgenerator.cpp | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/generators/qtdoc/qtdocgenerator.cpp b/generators/qtdoc/qtdocgenerator.cpp index ae7dcadf4..4c4a56812 100644 --- a/generators/qtdoc/qtdocgenerator.cpp +++ b/generators/qtdoc/qtdocgenerator.cpp @@ -40,11 +40,36 @@ static Indentor INDENT; static bool shouldSkip(const AbstractMetaFunction* func) { - return func->isConstructor() - || func->isModifiedRemoved() - || func->declaringClass() != func->ownerClass() - || func->isCastOperator() - || func->name() == "operator="; + bool skipable = func->isConstructor() + || func->isModifiedRemoved() + || func->declaringClass() != func->ownerClass() + || func->isCastOperator() + || func->name() == "operator="; + + // Search a const clone + if (!skipable && !func->isConstant()) { + const AbstractMetaArgumentList funcArgs = func->arguments(); + foreach (AbstractMetaFunction* f, func->ownerClass()->functions()) { + if (f != func + && f->isConstant() + && f->name() == func->name() + && f->arguments().count() == funcArgs.count()) { + // Compare each argument + bool cloneFound = true; + + const AbstractMetaArgumentList fargs = f->arguments(); + for (int i = 0, max = funcArgs.count(); i < max; ++i) { + if (funcArgs.at(i)->type()->typeEntry() != fargs.at(i)->type()->typeEntry()) { + cloneFound = false; + break; + } + } + if (cloneFound) + return true; + } + } + } + return skipable; } static bool functionSort(const AbstractMetaFunction *func1, const AbstractMetaFunction *func2) -- cgit v1.2.3