Add open online documentation button to help viewer

Change-Id: I21685005709332b1201aaf08804399ecbd82bf7c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Tasuku Suzuki
2019-06-13 15:41:03 +09:00
parent e3b1106afa
commit 395b5ec185
6 changed files with 50 additions and 12 deletions

View File

@@ -701,19 +701,8 @@ HelpViewer *HelpPluginPrivate::showHelpUrl(const QUrl &url, Core::HelpManager::H
return nullptr;
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().startsWith(qtcreatorUnversionedID))
urlPrefix.append(QString::fromLatin1("qtcreator"));
else
urlPrefix.append("qt-5");
QDesktopServices::openUrl(QUrl(urlPrefix + address.mid(address.lastIndexOf(QLatin1Char('/')))));
if (LocalHelpManager::openOnlineHelp(url))
return nullptr;
}
}
HelpViewer *viewer = viewerForHelpViewerLocation(location);