Commit c37f4d05 authored by Patrick Star's avatar Patrick Star
Browse files

Fixes: - missing F1 in tooltip on first IDE start

parent 908ee0e5
......@@ -60,7 +60,7 @@
using namespace CppTools::Internal;
CppHoverHandler::CppHoverHandler(CppModelManager *manager, QObject *parent)
: QObject(parent), m_manager(manager)
: QObject(parent), m_manager(manager), m_helpEngineNeedsSetup(false)
{
QFileInfo fi(ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>()->settings()->fileName());
m_helpEngine = new QHelpEngineCore(fi.absolutePath()
......@@ -68,6 +68,7 @@ CppHoverHandler::CppHoverHandler(CppModelManager *manager, QObject *parent)
//m_helpEngine->setAutoSaveFilter(false);
m_helpEngine->setupData();
m_helpEngine->setCurrentFilter(tr("Unfiltered"));
m_helpEngineNeedsSetup = m_helpEngine->registeredDocumentations().count() == 0;
}
void CppHoverHandler::updateContextHelpId(TextEditor::ITextEditor *editor, int pos)
......@@ -234,6 +235,12 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
}
}
if (m_helpEngineNeedsSetup
&& m_helpEngine->registeredDocumentations().count() > 0) {
m_helpEngine->setupData();
m_helpEngineNeedsSetup = false;
}
if (!m_helpId.isEmpty() && !m_helpEngine->linksForIdentifier(m_helpId).isEmpty()) {
m_toolTip = QString(QLatin1String("<table><tr><td valign=middle><nobr>%1</td>"
"<td><img src=\":/cpptools/images/f1.svg\"></td></tr></table>")).arg(Qt::escape(m_toolTip));
......
......@@ -68,6 +68,7 @@ private:
QHelpEngineCore *m_helpEngine;
QString m_helpId;
QString m_toolTip;
bool m_helpEngineNeedsSetup;
};
} // namespace Internal
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment