diff options
author | Jarek Kobus <jaroslaw.kobus@nokia.com> | 2011-11-10 11:55:05 +0100 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@nokia.com> | 2011-11-10 16:55:11 +0100 |
commit | da14d8610497ea5a272fae715efa18fc8643b9d7 (patch) | |
tree | 99c3b8189404d6405e7162c6edcadb904372055e /src/plugins/texteditor/helpitem.cpp | |
parent | 8fcb4d808415eab5f9b02fa448b03dff60191d9a (diff) | |
download | qt-creator-da14d8610497ea5a272fae715efa18fc8643b9d7.tar.gz |
Implement context help for pro file editor
Task-number: QTCREATORBUG-6325
Change-Id: Ie8b2eb582eb527eac6af56d0c69a8ae1dafdc1df
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
Diffstat (limited to 'src/plugins/texteditor/helpitem.cpp')
-rw-r--r-- | src/plugins/texteditor/helpitem.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/texteditor/helpitem.cpp b/src/plugins/texteditor/helpitem.cpp index af20367bf1..022d2eb59c 100644 --- a/src/plugins/texteditor/helpitem.cpp +++ b/src/plugins/texteditor/helpitem.cpp @@ -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; |