forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user