forked from qt-creator/qt-creator
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
This commit is contained in:
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user