forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -104,11 +104,12 @@ const char SB_SEARCH[] = QT_TRANSLATE_NOOP("Help::Internal::HelpPlugin", "Search
|
|||||||
const char SB_OPENPAGES[] = "OpenPages";
|
const char SB_OPENPAGES[] = "OpenPages";
|
||||||
|
|
||||||
#define IMAGEPATH ":/help/images/"
|
#define IMAGEPATH ":/help/images/"
|
||||||
#if defined(Q_OS_MAC)
|
|
||||||
# define DOCPATH "/../Resources/doc/"
|
static QString docPath()
|
||||||
#else
|
{
|
||||||
# define DOCPATH "/../share/doc/qtcreator/"
|
return QLatin1String(Utils::HostOsInfo::isMacHost()
|
||||||
#endif
|
? "/../Resources/doc/" : "/../share/doc/qtcreator/");
|
||||||
|
}
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
|
||||||
@@ -393,11 +394,11 @@ void HelpPlugin::extensionsInitialized()
|
|||||||
// without a qt development version. TODO: is this still really needed, remove
|
// without a qt development version. TODO: is this still really needed, remove
|
||||||
const QString &appPath = QCoreApplication::applicationDirPath();
|
const QString &appPath = QCoreApplication::applicationDirPath();
|
||||||
filesToRegister.append(QDir::cleanPath(QDir::cleanPath(appPath
|
filesToRegister.append(QDir::cleanPath(QDir::cleanPath(appPath
|
||||||
+ QLatin1String(DOCPATH "qml.qch"))));
|
+ docPath() + QLatin1String("qml.qch"))));
|
||||||
|
|
||||||
// we might need to register creators inbuild help
|
// we might need to register creators inbuild help
|
||||||
filesToRegister.append(QDir::cleanPath(appPath
|
filesToRegister.append(QDir::cleanPath(appPath
|
||||||
+ QLatin1String(DOCPATH "qtcreator.qch")));
|
+ docPath() + QLatin1String("qtcreator.qch")));
|
||||||
Core::HelpManager::instance()->registerDocumentation(filesToRegister);
|
Core::HelpManager::instance()->registerDocumentation(filesToRegister);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user