forked from qt-creator/qt-creator
Add open online documentation button to help viewer
Change-Id: I21685005709332b1201aaf08804399ecbd82bf7c Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user