Implement context help for pro file editor

Task-number: QTCREATORBUG-6325
Change-Id: Ie8b2eb582eb527eac6af56d0c69a8ae1dafdc1df
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
Jarek Kobus
2011-11-10 11:55:05 +01:00
parent 8fcb4d8084
commit da14d86104
11 changed files with 332 additions and 6 deletions

View File

@@ -77,6 +77,8 @@ bool HelpItem::isValid() const
{
if (!Core::HelpManager::instance()->linksForIdentifier(m_helpId).isEmpty())
return true;
if (QUrl(m_helpId).isValid())
return true;
return false;
}
@@ -90,6 +92,12 @@ QString HelpItem::extractContent(bool extended) const
QString contents;
QMap<QString, QUrl> helpLinks = Core::HelpManager::instance()->linksForIdentifier(m_helpId);
if (helpLinks.isEmpty()) {
// Maybe this is already an URL...
QUrl url(m_helpId);
if (url.isValid())
helpLinks.insert(m_helpId, m_helpId);
}
foreach (const QUrl &url, helpLinks) {
const QByteArray &html = Core::HelpManager::instance()->fileData(url);
switch (m_category) {
@@ -117,6 +125,9 @@ QString HelpItem::extractContent(bool extended) const
case QmlProperty:
contents = htmlExtractor.getQmlPropertyDescription(html, m_docMark);
break;
case QMakeVariableOfFunction:
contents = htmlExtractor.getQMakeVariableOrFunctionDescription(html, m_docMark);
break;
default:
break;