diff options
author | Leandro Melo <leandro.melo@nokia.com> | 2010-10-01 11:54:35 +0200 |
---|---|---|
committer | Leandro Melo <leandro.melo@nokia.com> | 2010-10-01 11:58:02 +0200 |
commit | 922e8e7866624e62f11f0ace2773960377299436 (patch) | |
tree | 61d09d2df5569cab03be58f23ea8451600039e66 /src/plugins/cppeditor/cpphoverhandler.cpp | |
parent | 3e104ce405281fb23ff2ffab24321d07ea7aa0f4 (diff) |
Help: All candidates (considering name qualification) are already in the list.
The C++ hover handler should just iterate over the list of candidates, since
it was created by the element evaluator considering all possible name qualifications
and in the right order.
Reviewed-by: kh1
Diffstat (limited to 'src/plugins/cppeditor/cpphoverhandler.cpp')
-rw-r--r-- | src/plugins/cppeditor/cpphoverhandler.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/plugins/cppeditor/cpphoverhandler.cpp b/src/plugins/cppeditor/cpphoverhandler.cpp index c8d1a9ffad..bd448ddafb 100644 --- a/src/plugins/cppeditor/cpphoverhandler.cpp +++ b/src/plugins/cppeditor/cpphoverhandler.cpp @@ -46,16 +46,6 @@ using namespace CppEditor::Internal; using namespace Core; -namespace { - QString removeClassNameQualification(const QString &name) { - const int index = name.lastIndexOf(QLatin1Char(':')); - if (index == -1) - return name; - else - return name.right(name.length() - index - 1); - } -} - CppHoverHandler::CppHoverHandler(QObject *parent) : BaseHoverHandler(parent) {} @@ -87,16 +77,8 @@ void CppHoverHandler::identifyMatch(TextEditor::ITextEditor *editor, int pos) QSharedPointer<CppElement> cppElement = evaluator.identifyCppElement(); if (!cppElement.isNull()) { setToolTip(cppElement->tooltip()); - foreach (QString helpId, cppElement->helpIdCandidates()) { - bool found = false; + foreach (const QString &helpId, cppElement->helpIdCandidates()) { if (!Core::HelpManager::instance()->linksForIdentifier(helpId).isEmpty()) { - found = true; - } else { - helpId = removeClassNameQualification(helpId); - if (!Core::HelpManager::instance()->linksForIdentifier(helpId).isEmpty()) - found = true; - } - if (found) { setLastHelpItemIdentified(TextEditor::HelpItem(helpId, cppElement->helpMark(), cppElement->helpCategory())); |