From 60f7f00e4121fa15b66a95ebf01907957410bbe1 Mon Sep 17 00:00:00 2001
From: Eike Ziller <eike.ziller@digia.com>
Date: Thu, 13 Jun 2013 15:50:19 +0200
Subject: [PATCH] Provide ICore::documentationPath()

Change-Id: I74e4ad7650296e897edc3313904168a720c8d360
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
---
 src/plugins/coreplugin/icore.cpp | 7 +++++++
 src/plugins/coreplugin/icore.h   | 1 +
 src/plugins/help/helpplugin.cpp  | 8 +-------
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp
index 85585277585..2a616b592ec 100644
--- a/src/plugins/coreplugin/icore.cpp
+++ b/src/plugins/coreplugin/icore.cpp
@@ -511,6 +511,13 @@ QString ICore::userResourcePath()
     return urp;
 }
 
+QString ICore::documentationPath()
+{
+    const QString docPath = QLatin1String(Utils::HostOsInfo::isMacHost()
+                                            ? "/../Resources/doc" : "/../share/doc/qtcreator");
+    return QDir::cleanPath(QCoreApplication::applicationDirPath() + docPath);
+}
+
 static QString compilerString()
 {
 #if defined(Q_CC_CLANG) // must be before GNU, because clang claims to be GNU too
diff --git a/src/plugins/coreplugin/icore.h b/src/plugins/coreplugin/icore.h
index f8d8b261c26..461035772f1 100644
--- a/src/plugins/coreplugin/icore.h
+++ b/src/plugins/coreplugin/icore.h
@@ -112,6 +112,7 @@ public:
 
     static QString resourcePath();
     static QString userResourcePath();
+    static QString documentationPath();
 
     static QString versionString();
     static QString buildCompatibilityString();
diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp
index d3fca830853..65c1c210474 100644
--- a/src/plugins/help/helpplugin.cpp
+++ b/src/plugins/help/helpplugin.cpp
@@ -105,12 +105,6 @@ const char SB_OPENPAGES[] = "OpenPages";
 
 #define IMAGEPATH ":/help/images/"
 
-static QString docPath()
-{
-    return QLatin1String(Utils::HostOsInfo::isMacHost()
-                         ? "/../Resources/doc/" : "/../share/doc/qtcreator/");
-}
-
 using namespace Core;
 
 static QToolButton *toolButton(QAction *action)
@@ -391,7 +385,7 @@ void HelpPlugin::extensionsInitialized()
     QStringList filesToRegister;
     // we might need to register creators inbuild help
     filesToRegister.append(QDir::cleanPath(QCoreApplication::applicationDirPath()
-        + docPath() + QLatin1String("qtcreator.qch")));
+        + ICore::documentationPath() + QLatin1String("/qtcreator.qch")));
     Core::HelpManager::instance()->registerDocumentation(filesToRegister);
 }
 
-- 
GitLab