diff options
author | Eike Ziller <eike.ziller@qt.io> | 2016-09-06 11:38:19 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2016-10-10 11:09:03 +0000 |
commit | b64bb0a7e3f4529282f4a27fa9fa72bc648673cf (patch) | |
tree | 49a499f3b4d135660b23c19a23e910374d3a3869 /src/plugins/help | |
parent | 82803f5a68b12b3b1b8d05f6657b83c0d7a3565d (diff) | |
download | qt-creator-b64bb0a7e3f4529282f4a27fa9fa72bc648673cf.tar.gz |
Help: Fix that help viewer opened even if URL is opened in browser
After we constructed the online URL for Qt/Qt Creator documentation that
is not installed locally, we can just open that via desktop services
instead of bothering built-in help viewers.
Change-Id: Ic8a37bc22d34af881b5daf87534d59db4d331e44
Task-number: QTCREATORBUG-16111
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Diffstat (limited to 'src/plugins/help')
-rw-r--r-- | src/plugins/help/helpplugin.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index f50a8ee5b8..115bdfbca4 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -622,25 +622,25 @@ void HelpPlugin::handleHelpRequest(const QUrl &url, HelpManager::HelpViewerLocat if (HelpViewer::launchWithExternalApp(url)) return; - QString address = url.toString(); if (!HelpManager::findFile(url).isValid()) { + const QString address = url.toString(); if (address.startsWith("qthelp://org.qt-project.") - || address.startsWith("qthelp://com.nokia.") - || 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") - urlPrefix.append(QString::fromLatin1("qtcreator")); - else - urlPrefix.append("qt-5"); - address = urlPrefix + address.mid(address.lastIndexOf(QLatin1Char('/'))); + || address.startsWith("qthelp://com.nokia.") + || 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") + urlPrefix.append(QString::fromLatin1("qtcreator")); + else + urlPrefix.append("qt-5"); + QDesktopServices::openUrl(QUrl(urlPrefix + address.mid(address.lastIndexOf(QLatin1Char('/'))))); + return; } } - const QUrl newUrl(address); HelpViewer *viewer = viewerForHelpViewerLocation(location); QTC_ASSERT(viewer, return); - viewer->setSource(newUrl); + viewer->setSource(url); ICore::raiseWindow(viewer); } |