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
This commit is contained in:
Leandro Melo
2010-09-30 13:59:11 +02:00
parent 9248e2cf46
commit cb99adfb0d

View File

@@ -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);
}