Move documentationPath() from Core::ICore to Core::HelpManager

It is documentation related API, so it belongs there.

Change-Id: I5d1676f251e6deb92050ddedac19bf3c332aab54
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Eike Ziller
2018-09-19 14:39:46 +02:00
parent 82688cabd1
commit b9db5ea86e
6 changed files with 11 additions and 8 deletions

View File

@@ -30,6 +30,8 @@
#include <extensionsystem/pluginspec.h> #include <extensionsystem/pluginspec.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QCoreApplication>
#include <QDir>
#include <QUrl> #include <QUrl>
namespace Core { namespace Core {
@@ -67,6 +69,11 @@ Implementation::~Implementation()
m_instance = nullptr; m_instance = nullptr;
} }
QString documentationPath()
{
return QDir::cleanPath(QCoreApplication::applicationDirPath() + '/' + RELATIVE_DOC_PATH);
}
void registerDocumentation(const QStringList &files) void registerDocumentation(const QStringList &files)
{ {
if (checkInstance()) if (checkInstance())

View File

@@ -58,6 +58,8 @@ enum HelpViewerLocation {
ExternalHelpAlways = 3 ExternalHelpAlways = 3
}; };
CORE_EXPORT QString documentationPath();
CORE_EXPORT void registerDocumentation(const QStringList &fileNames); CORE_EXPORT void registerDocumentation(const QStringList &fileNames);
CORE_EXPORT void unregisterDocumentation(const QStringList &nameSpaces); CORE_EXPORT void unregisterDocumentation(const QStringList &nameSpaces);

View File

@@ -445,11 +445,6 @@ QString ICore::installerResourcePath()
+ Constants::IDE_ID; + Constants::IDE_ID;
} }
QString ICore::documentationPath()
{
return QDir::cleanPath(QCoreApplication::applicationDirPath() + '/' + RELATIVE_DOC_PATH);
}
/*! /*!
Returns the path to the command line tools that are shipped with \QC (corresponding Returns the path to the command line tools that are shipped with \QC (corresponding
to the IDE_LIBEXEC_PATH qmake variable). to the IDE_LIBEXEC_PATH qmake variable).

View File

@@ -95,7 +95,6 @@ public:
static QString resourcePath(); static QString resourcePath();
static QString userResourcePath(); static QString userResourcePath();
static QString installerResourcePath(); static QString installerResourcePath();
static QString documentationPath();
static QString libexecPath(); static QString libexecPath();
static QString clangExecutable(const QString &clangBinDirectory); static QString clangExecutable(const QString &clangBinDirectory);
static QString clangIncludeDirectory(const QString &clangVersion, static QString clangIncludeDirectory(const QString &clangVersion,

View File

@@ -329,7 +329,7 @@ void HelpPlugin::extensionsInitialized()
{ {
QStringList filesToRegister; QStringList filesToRegister;
// we might need to register creators inbuild help // we might need to register creators inbuild help
filesToRegister.append(ICore::documentationPath() + "/qtcreator.qch"); filesToRegister.append(Core::HelpManager::documentationPath() + "/qtcreator.qch");
Core::HelpManager::registerDocumentation(filesToRegister); Core::HelpManager::registerDocumentation(filesToRegister);
} }

View File

@@ -111,7 +111,7 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
const Core::Context projectContext(::QbsProjectManager::Constants::PROJECT_ID); const Core::Context projectContext(::QbsProjectManager::Constants::PROJECT_ID);
Core::FileIconProvider::registerIconOverlayForSuffix(ProjectExplorer::Constants::FILEOVERLAY_QT, "qbs"); Core::FileIconProvider::registerIconOverlayForSuffix(ProjectExplorer::Constants::FILEOVERLAY_QT, "qbs");
Core::HelpManager::registerDocumentation({Core::ICore::documentationPath() + "/qbs.qch"}); Core::HelpManager::registerDocumentation({Core::HelpManager::documentationPath() + "/qbs.qch"});
ProjectManager::registerProjectType<QbsProject>(QmlJSTools::Constants::QBS_MIMETYPE); ProjectManager::registerProjectType<QbsProject>(QmlJSTools::Constants::QBS_MIMETYPE);
KitManager::registerKitInformation<QbsKitInformation>(); KitManager::registerKitInformation<QbsKitInformation>();