From d2e36ac8ff440c7abe695dab6c102ab3e02fc3ae Mon Sep 17 00:00:00 2001
From: Christian Kandeler <christian.kandeler@digia.com>
Date: Thu, 14 Mar 2013 12:18:15 +0100
Subject: [PATCH] Help: Remove unneeded #ifdef.

Replace compile-time check for Host OS with runtime check.

Change-Id: I149dc6dd8539e6598c84ae223df3cb76cc8ca675
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
---
 src/plugins/help/helpplugin.cpp | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp
index 9be566c9819..a2a73e64958 100644
--- a/src/plugins/help/helpplugin.cpp
+++ b/src/plugins/help/helpplugin.cpp
@@ -104,11 +104,12 @@ const char SB_SEARCH[] = QT_TRANSLATE_NOOP("Help::Internal::HelpPlugin", "Search
 const char SB_OPENPAGES[] = "OpenPages";
 
 #define IMAGEPATH ":/help/images/"
-#if defined(Q_OS_MAC)
-#   define DOCPATH "/../Resources/doc/"
-#else
-#   define DOCPATH "/../share/doc/qtcreator/"
-#endif
+
+static QString docPath()
+{
+    return QLatin1String(Utils::HostOsInfo::isMacHost()
+                         ? "/../Resources/doc/" : "/../share/doc/qtcreator/");
+}
 
 using namespace Core;
 
@@ -393,11 +394,11 @@ void HelpPlugin::extensionsInitialized()
     // without a qt development version. TODO: is this still really needed, remove
     const QString &appPath = QCoreApplication::applicationDirPath();
     filesToRegister.append(QDir::cleanPath(QDir::cleanPath(appPath
-        + QLatin1String(DOCPATH "qml.qch"))));
+        + docPath() + QLatin1String("qml.qch"))));
 
     // we might need to register creators inbuild help
     filesToRegister.append(QDir::cleanPath(appPath
-        + QLatin1String(DOCPATH "qtcreator.qch")));
+        + docPath() + QLatin1String("qtcreator.qch")));
     Core::HelpManager::instance()->registerDocumentation(filesToRegister);
 }
 
-- 
GitLab