summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2017-09-11 12:33:35 +0200
committerEike Ziller <eike.ziller@qt.io>2017-09-12 07:32:34 +0000
commit8e3efd92c68855365d6d20802bc3d0fa5ee45f74 (patch)
tree1ec4e449e15f315ce8d6a4ffd36a6c232f728e52
parentf2e5e220090a88d6d65bc1d417faae99a497a1db (diff)
downloadqt-creator-8e3efd92c68855365d6d20802bc3d0fa5ee45f74.tar.gz
Fix Get Started Now (and other links)
If we do not specify the correct documentation URL including the version number, QtHelp will look for any documentation that has the given path. Since we now register Qbs documentation, and that also has a file "doc/index.html", the Get Started Now button could open the Qbs manual instead of the Qt Creator one. Specify the full documentation URL including version number to ensure that QtHelp opens the right page. Change-Id: Ia77103fe2763dd208d3b9a279a8301f7f5799c8b Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r--src/plugins/help/helpplugin.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp
index 39fe63a376..2057059483 100644
--- a/src/plugins/help/helpplugin.cpp
+++ b/src/plugins/help/helpplugin.cpp
@@ -629,6 +629,16 @@ void HelpPlugin::highlightSearchTermsInContextHelp()
void HelpPlugin::handleHelpRequest(const QUrl &url, HelpManager::HelpViewerLocation location)
{
+ static const QString qtcreatorUnversionedID = "org.qt-project.qtcreator";
+ if (url.host() == qtcreatorUnversionedID) {
+ // QtHelp doesn't know about versions, add the version number and use that
+ QUrl versioned = url;
+ versioned.setHost(qtcreatorUnversionedID + "."
+ + QString::fromLatin1(Core::Constants::IDE_VERSION_LONG).remove('.'));
+ handleHelpRequest(versioned, location);
+ return;
+ }
+
if (HelpViewer::launchWithExternalApp(url))
return;
@@ -639,7 +649,7 @@ void HelpPlugin::handleHelpRequest(const QUrl &url, HelpManager::HelpViewerLocat
|| address.startsWith("qthelp://com.trolltech.")) {
// local help not installed, resort to external web help
QString urlPrefix = "http://doc.qt.io/";
- if (url.authority() == "org.qt-project.qtcreator")
+ if (url.authority().startsWith(qtcreatorUnversionedID))
urlPrefix.append(QString::fromLatin1("qtcreator"));
else
urlPrefix.append("qt-5");