aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2019-10-10 11:30:51 +0200
committerTobias Hunger <tobias.hunger@qt.io>2019-10-16 10:40:03 +0000
commite38ccf16cdb9c9d3829fed643afc829ce633473b (patch)
treed45ae5a44a88ac7755e7f40f670f422dbb675b91 /src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp
parentc12a80306c82605d7969ca9ffe4b2cbfd5039c06 (diff)
CMake: Make use of CMake-provided .qch files
* Have UI to select a .qch file location in CMake Tool setup * Auto-detect CMake's .qch file in its default location (relative to the cmake executable) * Register the .qch files with the HelpManager Task-number: QTCREATORBUG-21338 Change-Id: I4057eec42c39535012d9f0daf788fc62ef20d544 Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp')
-rw-r--r--src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp
index 77f3e077a2..fd7af452c7 100644
--- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp
+++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp
@@ -27,6 +27,7 @@
#include "cmaketoolsettingsaccessor.h"
+#include <coreplugin/helpmanager.h>
#include <coreplugin/icore.h>
#include <utils/pointeralgorithm.h>
@@ -105,6 +106,8 @@ bool CMakeToolManager::registerCMakeTool(std::unique_ptr<CMakeTool> &&tool)
ensureDefaultCMakeToolIsValid();
+ updateDocumentation();
+
return true;
}
@@ -112,9 +115,10 @@ void CMakeToolManager::deregisterCMakeTool(const Id &id)
{
auto toRemove = Utils::take(d->m_cmakeTools, Utils::equal(&CMakeTool::id, id));
if (toRemove.has_value()) {
-
ensureDefaultCMakeToolIsValid();
+ updateDocumentation();
+
emit m_instance->cmakeRemoved(id);
}
}
@@ -152,9 +156,22 @@ void CMakeToolManager::restoreCMakeTools()
d->m_cmakeTools = std::move(tools.cmakeTools);
setDefaultCMakeTool(tools.defaultToolId);
+ updateDocumentation();
+
emit m_instance->cmakeToolsLoaded();
}
+void CMakeToolManager::updateDocumentation()
+{
+ const QList<CMakeTool *> tools = cmakeTools();
+ QStringList docs;
+ for (const auto tool : tools) {
+ if (!tool->qchFilePath().isEmpty())
+ docs.append(tool->qchFilePath().toString());
+ }
+ Core::HelpManager::registerDocumentation(docs);
+}
+
void CMakeToolManager::notifyAboutUpdate(CMakeTool *tool)
{
if (!tool || !Utils::contains(d->m_cmakeTools, tool))