Commit cb99adfb authored by Leandro Melo's avatar Leandro Melo
Browse files

Help: Fix help ids for qt built with namespaces.

This is actually a general improvement that splits the qualified names
so more help ids candidates are considered when searching in the docs.

Reviewed-by: kh1
parent 9248e2cf
......@@ -314,16 +314,23 @@ CppDeclarableElement::CppDeclarableElement(Symbol *declaration) : CppElement()
declaration->enclosingScope()->isNamespace() ||
declaration->enclosingScope()->isEnum()) {
m_qualifiedName = overview.prettyName(LookupContext::fullyQualifiedName(declaration));
QStringList helpIds;
helpIds << m_qualifiedName;
int colonColon = 0;
const int size = m_qualifiedName.size();
while ((colonColon = m_qualifiedName.indexOf(QLatin1String("::"), colonColon)) != -1) {
helpIds << m_qualifiedName.right(size - colonColon - 2);
colonColon += 2;
}
setHelpIdCandidates(helpIds);
} else {
m_qualifiedName = m_name;
setHelpIdCandidates(QStringList(m_name));
}
setTooltip(overview.prettyType(declaration->type(), m_qualifiedName));
setLink(CPPEditor::linkToSymbol(declaration));
QStringList helpIds;
helpIds << m_qualifiedName << m_name;
setHelpIdCandidates(helpIds);
setHelpMark(m_name);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment