forked from qt-creator/qt-creator
Help: Avoid trying to open "Foo::bar" as a url in a browser.
Technically it is a valid URL with scheme "Foo" and path ":bar". With this patch we only try to open URLs with very specific schemes like "qthelp", "file", "http(s)", "about". Task-number: QTCREATORBUG-7547 Change-Id: I6908ff554c12ca0f4cfc5bd0fb30dd659d780a23 Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
This commit is contained in:
@@ -888,15 +888,9 @@ void HelpPlugin::activateContext()
|
||||
if (IContext *context = Core::ICore::currentContextObject()) {
|
||||
m_idFromContext = context->contextHelpId();
|
||||
links = HelpManager::linksForIdentifier(m_idFromContext);
|
||||
if (links.isEmpty()) {
|
||||
// Maybe this is already an URL...
|
||||
// Require protocol specifier, otherwise most strings would be 'local file names'
|
||||
if (m_idFromContext.contains(QLatin1Char(':'))) {
|
||||
QUrl url(m_idFromContext);
|
||||
if (url.isValid())
|
||||
links.insert(m_idFromContext, m_idFromContext);
|
||||
}
|
||||
}
|
||||
// Maybe the id is already an URL
|
||||
if (links.isEmpty() && LocalHelpManager::isValidUrl(m_idFromContext))
|
||||
links.insert(m_idFromContext, m_idFromContext);
|
||||
}
|
||||
|
||||
if (HelpViewer* viewer = viewerForContextMode()) {
|
||||
|
||||
Reference in New Issue
Block a user