From c15a2bcd226ae675d60375ef7e1dabb62a88e9ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com>
Date: Tue, 1 Jun 2010 13:04:05 +0200
Subject: [PATCH] Fixed context help for Qt includes

Was broken in 915a07bdbbd5dc65332369a117acde58793a165d, which caused
help links only to be resolved for expressions under the cursor.

Task-number: QTCREATORBUG-159
Reviewed-by: ckamm
---
 src/plugins/cppeditor/cpphoverhandler.cpp | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/plugins/cppeditor/cpphoverhandler.cpp b/src/plugins/cppeditor/cpphoverhandler.cpp
index 2c91f5cba4b..dabf25c7917 100644
--- a/src/plugins/cppeditor/cpphoverhandler.cpp
+++ b/src/plugins/cppeditor/cpphoverhandler.cpp
@@ -297,23 +297,24 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
         }
     }
 
+    if (m_helpEngineNeedsSetup
+        && m_helpEngine->registeredDocumentations().count() > 0) {
+        m_helpEngine->setupData();
+        m_helpEngineNeedsSetup = false;
+    }
+    QMap<QString, QUrl> helpLinks;
+
     if (m_toolTip.isEmpty()) {
         foreach (const Document::Include &incl, doc->includes()) {
             if (incl.line() == lineNumber) {
                 m_toolTip = QDir::toNativeSeparators(incl.fileName());
                 m_helpId = QFileInfo(incl.fileName()).fileName();
+                helpLinks = m_helpEngine->linksForIdentifier(m_helpId);
                 break;
             }
         }
     }
 
-    if (m_helpEngineNeedsSetup
-        && m_helpEngine->registeredDocumentations().count() > 0) {
-        m_helpEngine->setupData();
-        m_helpEngineNeedsSetup = false;
-    }
-
-    QMap<QString, QUrl> helpLinks;
     if (m_helpId.isEmpty()) {
         // Move to the end of a qualified name
         bool stop = false;
-- 
GitLab