From da14d8610497ea5a272fae715efa18fc8643b9d7 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Thu, 10 Nov 2011 11:55:05 +0100 Subject: Implement context help for pro file editor Task-number: QTCREATORBUG-6325 Change-Id: Ie8b2eb582eb527eac6af56d0c69a8ae1dafdc1df Reviewed-by: Leandro Melo --- src/plugins/texteditor/helpitem.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/plugins/texteditor/helpitem.cpp') 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 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; -- cgit v1.2.1