CMakePM: Add options link to the CMake offline/online documentation

This way a user can quickly find out which options can be used.

Change-Id: I6347759689a4a1431a82ff9414da0c79e357eb45
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Cristian Adam
2022-02-03 16:12:41 +01:00
parent da95472eb7
commit 68cb80f276
6 changed files with 53 additions and 4 deletions

View File

@@ -27,6 +27,8 @@
#include "cmaketoolmanager.h"
#include <coreplugin/helpmanager.h>
#include <utils/algorithm.h>
#include <utils/environment.h>
#include <utils/qtcassert.h>
@@ -380,6 +382,28 @@ FilePath CMakeTool::searchQchFile(const FilePath &executable)
return {};
}
QString CMakeTool::documentationUrl(bool online) const
{
if (online)
return QString("https://cmake.org/cmake/help/v%1.%2")
.arg(version().major)
.arg(version().minor);
return QString("qthelp://org.cmake.%1.%2.%3/doc")
.arg(version().major)
.arg(version().minor)
.arg(version().patch);
}
void CMakeTool::openCMakeHelpUrl(const QString &linkUrl) const
{
if (!isValid())
return;
const bool online = qchFilePath().isEmpty();
Core::HelpManager::showHelpUrl(linkUrl.arg(documentationUrl(online)));
}
void CMakeTool::readInformation() const
{
QTC_ASSERT(m_introspection, return );