Fix F1 sometimes opening explorer/finder if documentation is not found

It's not sufficient to try to create a QUrl on a string to find out if
it is an url, because that automatically treats strings without any
special characters as "local file urls".

Task-number: QTCREATORBUG-11570
Change-Id: I18071aed5b3fbdd717b045c2f6e3e90385be8584
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Eike Ziller
2014-02-26 12:18:35 +01:00
parent c4f5bdfbdb
commit e4feb5e326

View File

@@ -874,11 +874,14 @@ void HelpPlugin::activateContext()
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);
}
}
}
if (HelpViewer* viewer = viewerForContextMode()) {
if (links.isEmpty()) {