diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 9be566c98195971dc36f5bb99f2b526c30641d02..a2a73e6495857aa9a9bc40f83a59297d0aaefc72 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); }