diff options
author | Martin Smith <martin.smith@digia.com> | 2012-10-08 12:49:39 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-10 10:44:12 +0200 |
commit | 9418be80ec0e8a2629ff9bbb4d1a1c6309aa763d (patch) | |
tree | 190e10069eb02288091847ced11ce2ab8ec968a5 /src/tools/qdoc/qdocdatabase.cpp | |
parent | c12b4f26852bc885217ae5ddcd105d88a502328a (diff) |
qdoc: Implements the -no-link-errors option
The -no-link-errors flag tells qdoc not to print any link error
messages at all. This is useful for finding and fixing all non-link
errors in a module.
Task number: QTBUG-26870
Change-Id: Id4b0eebb6c0509c57d2f01763b6dedbfb6756a91
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
Diffstat (limited to 'src/tools/qdoc/qdocdatabase.cpp')
-rw-r--r-- | src/tools/qdoc/qdocdatabase.cpp | 63 |
1 files changed, 19 insertions, 44 deletions
diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp index 8780c67361..0c0b30e8c7 100644 --- a/src/tools/qdoc/qdocdatabase.cpp +++ b/src/tools/qdoc/qdocdatabase.cpp @@ -652,63 +652,39 @@ void QDocDatabase::insertTarget(const QString& name, Node* node, int priority) finds one, it sets \a ref and returns the found node. */ const Node* -QDocDatabase::findUnambiguousTarget(const QString& target, QString& ref, const Node* relative) const +QDocDatabase::findUnambiguousTarget(const QString& target, QString& ref, const Node* relative) { Target bestTarget; int numBestTargets = 0; QList<Target> bestTargetList; - bool debug = false; - if (target == "Manager" && Generator::debugging()) - debug = true; - QString key = Doc::canonicalTitle(target); - TargetMultiMap::const_iterator i = targetMultiMap_.constFind(key); - if (i != targetMultiMap_.constEnd()) { - if (debug) - qDebug() << "DEBUG: A"; - TargetMultiMap::const_iterator j = i; - do { - const Target& candidate = j.value(); - if (candidate.priority_ < bestTarget.priority_) { - if (debug) - qDebug() << "DEBUG: B"; - bestTarget = candidate; - bestTargetList.clear(); - bestTargetList.append(candidate); - numBestTargets = 1; - } else if (candidate.priority_ == bestTarget.priority_) { - if (debug) - qDebug() << "DEBUG: C"; - bestTargetList.append(candidate); - ++numBestTargets; - } - ++j; - } while (j != targetMultiMap_.constEnd() && j.key() == i.key()); - - if (debug) - qDebug() << "DEBUG: D"; + TargetMultiMap::iterator i = targetMultiMap_.find(key); + while (i != targetMultiMap_.end()) { + if (i.key() != key) + break; + const Target& candidate = i.value(); + if (candidate.priority_ < bestTarget.priority_) { + bestTarget = candidate; + bestTargetList.clear(); + bestTargetList.append(candidate); + numBestTargets = 1; + } else if (candidate.priority_ == bestTarget.priority_) { + bestTargetList.append(candidate); + ++numBestTargets; + } + ++i; + } + if (numBestTargets > 0) { if (numBestTargets == 1) { - if (debug) - qDebug() << "DEBUG: E"; ref = bestTarget.ref_; return bestTarget.node_; } else if (bestTargetList.size() > 1) { - if (debug) - qDebug() << "DEBUG: F"; if (relative && !relative->qmlModuleIdentifier().isEmpty()) { - if (debug) - qDebug() << "DEBUG: G"; for (int i=0; i<bestTargetList.size(); ++i) { - if (debug) - qDebug() << "DEBUG: H"; const Node* n = bestTargetList.at(i).node_; - if (debug) - qDebug() << "DEBUG: I"; if (n && relative->qmlModuleIdentifier() == n->qmlModuleIdentifier()) { - if (debug) - qDebug() << "DEBUG: J"; ref = bestTargetList.at(i).ref_; return n; } @@ -716,8 +692,7 @@ QDocDatabase::findUnambiguousTarget(const QString& target, QString& ref, const N } } } - if (debug) - qDebug() << "DEBUG: K"; + ref.clear(); return 0; } |